2

using sendmailR the code is

library(sendmailR)

sendmail(from, to, subject, body,
         control = list(smtpServer='ASPMX.L.GOOGLE.COM'))

and using mailR it's like

library(mailR)

send.mail(from, to, subject, body,
          smtp = list(host.name = "smtp.gmail.com", port = 465, 
                      user.name="something@gmail.com", passwd="something", ssl=TRUE),
          authenticate = TRUE,
          send = TRUE)

I was wondering why the password is not needed in the 1st code? Is 'ASPMX.L.GOOGLE.COM' some agreement which includes password?

In fact the 2nd code worked for me and the 1st code yielded

Error in socketConnection(host = server, port = port, blocking = TRUE) : 
  cannot open the connection
In addition: Warning message:
In socketConnection(host = server, port = port, blocking = TRUE) :
  ASPMX.L.GOOGLE.COM:25 cannot be opened

I'm in win 7.

YJZ
  • 3,934
  • 11
  • 43
  • 67
  • SMTP on port 25 uses no authentication, but apparently the server you're trying to contact does not listen on port 25. – Matthew Lundberg Aug 30 '15 at 03:04
  • This @Matthew Lundberg does no authentication mean I can send email using other people's email account? could u tell me more about the port? Thanks a lot – YJZ Aug 30 '15 at 04:34
  • This post may help: http://stackoverflow.com/questions/15421130/use-sendmailr-with-windows – Oleg Melnikov Jul 20 '16 at 02:41

0 Answers0