rpremraj / mailR

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

Error sending email to port 587. Still using 465 #69

Closed fcjbispo closed 6 years ago

fcjbispo commented 6 years ago

Hi, I'm trying to send a rmarkdown report to some google emails using google smtp service, but i got an error about port 465 even i'm setting the port to 587 and using ssl/tls.

I wonder i have to set up the ssl port to 587, but i don`t know how to do this.

These are my code and the output produced when call the object methods. Can you help me?

email <- send.mail(from = 'xxx@gmail.com', to = c('yyyy@gmail.com'), subject = "Subject", body = 'knitr_report.html', html = TRUE, smtp = list(host.name = "smtp.gmail.com", port = 587, user.name = "XXXXXX", passwd = "XXXX", ssl = TRUE, tls = TRUE), authenticate = TRUE, send = FALSE)

email$getHostName() [1] "smtp.gmail.com" email$getSmtpPort() [1] "587" email$getSslSmtpPort() [1] "465" email$send() Error in .jcall("RJavaTools", "Ljava/lang/Object;", "invokeMethod", cl, : org.apache.commons.mail.EmailException: Sending the email to the following server failed : smtp.gmail.com:465

fcjbispo commented 6 years ago

Hi,

After turn debug on, i realized issues with authentication. Problem solved.