I am trying to send email from R using MailR package. This works awesome when I try on my personal gmail account. But when I try to run same with my corporate mail id, it doesn't work. One problem I found is because of 2 step authentication. I have removed 2 step authentication for my personal mail account but unable to for my corporate account. Is there any way I can include a password or authentication in mailR package code?
My code:
library(rJava)
library(mailR)
send.mail(from = "emailid",
to = "emailid",
subject = "Subject of the email",
body = "Please find the attached doc having cluster report",
html = TRUE,
smtp = list(host.name = "smtp.gmail.com",port = 465, user.name="emailid", passwd="*******",ssl = TRUE),
attach.files ="./Prod tracker-new Jul28-Aug2.csv",
authenticate = TRUE,
send = TRUE)