unable to send an email from gmail id through mailR package

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

unable to send an email from gmail id through mailR package

akshayjhawar
Hi all,

For a day, I have been trying to send an email to my gmail account but unfortunately nothing is working. I have tried with different ports on the smtp.gmail.com and also enable google setting for less secure apps but then also I am seeing errors

Below is the code that I am using:

library(mailR)
sender <- "<*********@gmail.com>"
recipients <- c("**********@gmail.com")
send.mail(from = sender,
          to = recipients,
          subject = "Test",
          body = "Test",
          smtp = list(host.name = "smtp.gmail.com", port=465 ,
                      user.name = "**************@gmail.com",            
                      passwd = "*******", ssl = TRUE),
          authenticate = TRUE,
          send = TRUE)

Th error is very large but by going through, it basically says that it is not able to make a connection to the smtp server. Kindly help me in this issue as I am stuck at it for a day.

Thanks
Akshay