Getting the error while sending the mailR package from R

2308 views r

with continuing thread link i have tried to send the sample mail from college system but fails in r to send also getting the below error.

org.apache.commons.mail.EmailException: Sending the email to the following server failed :
at org.apache.commons.mail.Email.sendMimeMessage(
at org.apache.commons.mail.Email.send(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(
at RJavaTools.invokeMethod(
Caused by: javax.mail.AuthenticationFailedException: 534-5.7.9 Application-specific password required. Learn more at
534 5.7.9 p87-v6sm20894169pfk.186 - gsmtp

at com.sun.mail.smtp.SMTPTransport$Authenticator.authenticate(
at com.sun.mail.smtp.SMTPTransport.authenticate(
at com.sun.mail.smtp.SMTPTransport.protocolConnect(
at javax.mail.Service.connect(
at javax.mail.Service.connect(
at javax.mail.Service.connect(
at javax.mail.Transport.send0(
at javax.mail.Transport.send(
at org.apache.commons.mail.Email.sendMimeMessage(
... 6 more
EmailException (Java): Sending the email to the following server failed :[1] "Java-Object{org.apache.commons.mail.ImageHtmlEmail@58ceff1}"

how to fix the error and please help me to send the mail using r?

answered question

1 Answer


problem might be at 2 levels

first check the mail using to sent like u will get any messages like warning messages from google as your account is trying to access some miscellaneous apps or like that... if u got message then nothing problem at R side

so your next step is to check from google end

use link to enable low secure apps in google

please enable low secure apps turn ON and try again.

Note : first check java is properly linked or not and working properly or not in R (test with run of library(rJava)) if it run successfully java is perfectly enabled with proper path, otherwise need to set the proper java home path according to the Operating System.

posted this

Have an answer?


Please login first before posting an answer.