我想用{mailR}
用于发送带有身份验证的电子邮件通知的包。这个包的支持者是{rJava}
并使用 Java 设施。
我注册了 Outlook.com 帐户。
这是代码:
library(mailR)
email <- send.mail(
from="(account-name)@outlook.com",
to="(my-account)@outlook.com",
subject="Test message from server",
body="Hello, this is a test message.",
smtp=list(host.name="smtp-mail.outlook.com",port=25,
user.name="(account-name)@outlook.com",passwd="(account-password)",
ssl = TRUE),
authenticate=TRUE,
send=TRUE
)
I read http://windows.microsoft.com/en-us/windows/outlook/send-receive-from-app http://windows.microsoft.com/en-us/windows/outlook/send-receive-from-app并尝试了所有可能的主机名(smtp.live.com、smtp.outlook.com、smtp-mail.outlook.com)和端口(25、587),但这都会导致以下错误:
Error in .jcall("RJavaTools", "Ljava/lang/Object;", "invokeMethod", cl, :
org.apache.commons.mail.EmailException: Sending the email to the following server failed : smtp-mail.outlook.com:465
问题是什么? R 中是否有一个可行的解决方案来发送带有身份验证的电子邮件?