rpremraj / mailR

A utility to send emails from the R programming environment
http://rpremraj.github.io/mailR/
190 stars 57 forks source link

protocol error #102

Open richard987 opened 3 years ago

richard987 commented 3 years ago

send.mail(from = sender, to = recipients, replyTo = c("Reply to someone else someone.else@gmail.com"), subject = "Subject of the email", body = "Body of the email", smtp = list(host.name = "smtp.gmail.com", port = 465, user.name = "", passwd = "", ssl = TRUE), authenticate = TRUE, send = TRUE)

gives error (same for tls):

org.apache.commons.mail.EmailException: Sending the email to the following server failed : smtp.gmail.com:465 at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1410) at org.apache.commons.mail.Email.send(Email.java:1437) at jdk.internal.reflect.GeneratedMethodAccessor7.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:567) at RJavaTools.invokeMethod(RJavaTools.java:386) Caused by: javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 465; nested exception is: javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate) at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:2055) at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:697) at javax.mail.Service.connect(Service.java:386) at javax.mail.Service.connect(Service.java:2NULL 45) at javax.mail.Service.connect(Service.java:194) at javax.mail.Transport.send0(Transport.java:253) at javax.mail.Transport.send(Transport.java:124) at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1400) ... 5 more Caused by: javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate) at java.base/sun.security.ssl.HandshakeContext.(HandshakeContext.java:172) at java.base/sun.security.ssl.ClientHandshakeContext.(ClientHandshakeContext.java:98) at java.base/sun.security.ssl.TransportContext.kickstart(TransportContext.java:238) at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:434) at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:412) at com.sun.mail.util.SocketFetcher.configureSSLSocket(SocketFetcher.java:543) at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:348) at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:215) at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:2019) ... 12 more Error: EmailException (Java): Sending the email to the following server failed : smtp.gmail.com:465

daattali commented 3 years ago

Probably the same as https://github.com/rpremraj/mailR/issues/100 - look at their solution

sclewis23 commented 2 years ago

Hey this package repo was moved to: https://github.com/rpremrajGit/mailR and this issue has been resolved in the latest version of mailR 0.8 on CRAN.

daattali commented 2 years ago

Thank for letting us know!