我想從Windows 7(家庭)機器上的R發送郵件。我嘗試下面的代碼從R發送郵件(郵件R)
send.mail(from = "[email protected]",
to = c("[email protected]"),
subject = "Subject of the email",
body = "Body of the email",
smtp = list(host.name = "smtp.gmail.com", port = 465, user.name = "myuserid", passwd = "my password", ssl = TRUE),
authenticate = TRUE,
send = TRUE)
我得到以下錯誤: 錯誤LS(ENVIR = ENVIR,all.names =私人): 無效 'ENVIR' 的說法
後,我試圖成立一個hmail服務器(具有本地域名和用戶帳戶和SMTP設置爲smtp.gmail.com:25)
send.mail(from = "[email protected]",
to = c("[email protected]"),
subject = "Subject of the email",
body = "Body of the email",
smtp = list(host.name = "mail.hmailserver.com", port = 25),
authenticate = FALSE,
send = TRUE)
我仍然得到同樣的錯誤。任何幫助將不勝感激。由於VM
嘗試[啓用](https://www.google.com/settings/security/lesssecureapps)爲您的谷歌帳戶的SMTP訪問。 – m0nhawk 2015-04-04 19:21:48