0
`send.mail(from = "test1234@gmail.com",
 to = "recieve1234@gmailcom",
 subject = "test_email",
 body ="hi",
 smtp = list(host.name = "smtp.gmail.com", port = 465, user.name = "",passwd = "", ssl = TRUE)
 authenticate = FALSE,
 send = TRUE)` 

Error: EmailException (Java): Sending the email to the following server failed : smtp.gmail.com:465

Abhishek Gupta
  • 151
  • 1
  • 14
  • According to [here](https://stackoverflow.com/questions/39093335/sending-an-email-through-r) possible solution is to turn on lesssecureapps got it from [here](https://stackoverflow.com/a/26741058/6444625) – hungrykoala May 11 '18 at 06:20

1 Answers1

0

Trivially, you'll need to specify a username and password when connecting to GMail's SMTP server:

smtp = list(host.name = "smtp.gmail.com", port = 465,
    user.name = "abhishek.gupta@gmail.com", passwd = "your_password", ssl = TRUE)

Also, you might have to set the authenticate parameter to send.mail to TRUE.

Tim Biegeleisen
  • 502,043
  • 27
  • 286
  • 360