I want to use {mailR}
package to send email notifications with authentication. This package is backended by {rJava}
and uses Java facilities.
I registered an Outlook.com account.
Here's the code:
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 and tried all possible host names (smtp.live.com, smtp.outlook.com, smtp-mail.outlook.com) and ports (25, 587), but it all results in the following error:
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
What is the problem? Is there a working solution to send email with authentication in R?