Problem sending mail from R using mailR package

I am trying to schedule sending an attachment mail through mailR package using office365.
Below is code snippet..

send.mail(from = from,
            to = to,
            subject = subject,
            body = body,
            smtp = list( = "", port = 443,
               = "", passwd = "password", tls = TRUE),
            authenticate = FALSE,
            attach.files = c("./file.csv"),
            file.names = c("file.csv"),
            file.descriptions = c("Description"))

I am getting below error.

org.apache.commons.mail.EmailException: Sending the email to the following server failed :
	at org.apache.commons.mail.Email.sendMimeMessage(
	at org.apache.commons.mail.Email.send(
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(
	at java.lNULL
	at RJavaTools.invokeMethod(
Caused by: com.sun.mail.util.MailConnectException: Couldn't connect to host, port:, 443; timeout 60000;
  nested exception is:
	at com.sun.mail.smtp.SMTPTransport.openServer(
	at com.sun.mail.smtp.SMTPTransport.protocolConnect(
	at javax.mail.Service.connect(
	at javax.mail.Service.connect(
	at javax.mail.Service.connect(
	at javax.mail.Transport.send0(
	at javax.mail.Transport.send(
	at org.apache.commons.mail.Email.sendMimeMessage(
	... 6 more
Caused by:
	at com.sun.mail.util.SocketFetcher.createSocket(
	at com.sun.mail.util.SocketFetcher.getSocket(
	at com.sun.mail.smtp.SMTPTransport.openServer(
	... 13 more
Error: EmailException (Java): Sending the email to the following server failed :

The host name is provided as present in server tab in account section of outlook
Can someone suggest way forward please?

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.