datawookie/emayili

Error with Office365

Sanotarro opened this issue · 1 comments

Hi all, i use this package for send mailing from R with Outlook 2016 (office365 server) and i have this error:

Server
serverSMTP = "smtp.office365.com"
port= 587

Error
Hostname in DNS cache was stale, zapped
Trying xx.xx.x.xxx...
TCP_NODELAY set
Connected to smtp.office365.com (xx.xx.x.xxx) port 587 (#20)
220 SC1PR80CA0174.outlook.office365.com Microsoft ESMTP MAIL Service ready at Mon, 27 Mar 2023 18:17:53 +0000
EHLO BULP05N020
250-SC1PR80CA0174.outlook.office365.com Hello [xxx.xxx.xx.x]
250-SIZE 157286400
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-STARTTLS
250-8BITMIME
250-BINARYMIME
250-CHUNKING
250 SMTPUTF8
STARTTLS
220 2.0.0 SMTP server ready
schannel: failed to receive handshake, SSL/TLS connection failed
Closing connection 20
schannel: shutting down SSL/TLS connection with smtp.office365.com port 587
Hostname smtp.office365.com was found in DNS cache
Trying xx.xx.x.xxx...
TCP_NODELAY set
Connected to smtp.office365.com (xx.xx.x.xxx) port 587 (#21)
220 SC1PR80CA0163.outlook.office365.com Microsoft ESMTP MAIL Service ready at Mon, 27 Mar 2023 18:17:55 +0000
EHLO BULP05N020
250-SC1PR80CA0163.outlook.office365.com Hello [xxx.xxx.xx.x]
250-SIZE 157286400
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-STARTTLS
250-8BITMIME
250-BINARYMIME
250-CHUNKING
250 SMTPUTF8
STARTTLS
220 2.0.0 SMTP server ready
schannel: failed to receive handshake, SSL/TLS connection failed
Closing connection 21
schannel: shutting down SSL/TLS connection with smtp.office365.com port 587
Hostname smtp.office365.com was found in DNS cache
Trying xx.xx.x.xxx...
TCP_NODELAY set
Connected to smtp.office365.com (xx.xx.x.xxx) port 587 (#22)
220 SC1PR80CA0173.outlook.office365.com Microsoft ESMTP MAIL Service ready at Mon, 27 Mar 2023 18:18:00 +0000
EHLO BULP05N020
250-SC1PR80CA0173.outlook.office365.com Hello [xxx.xxx.xx.x]
250-SIZE 157286400
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-STARTTLS
250-8BITMIME
250-BINARYMIME
250-CHUNKING
250 SMTPUTF8
STARTTLS
220 2.0.0 SMTP server ready
schannel: failed to receive handshake, SSL/TLS connection failed
Closing connection 22
schannel: shutting down SSL/TLS connection with smtp.office365.com port 587
Hostname smtp.office365.com was found in DNS cache
Trying xx.xx.x.xxx...
TCP_NODELAY set
Connected to smtp.office365.com (xx.xx.x.xxx) port 587 (#23)
220 SC1PR80CA0172.outlook.office365.com Microsoft ESMTP MAIL Service ready at Mon, 27 Mar 2023 18:18:10 +0000
EHLO BULP05N020
250-SC1PR80CA0172.outlook.office365.com Hello [xxx.xxx.xx.x]
250-SIZE 157286400
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-STARTTLS
250-8BITMIME
250-BINARYMIME
250-CHUNKING
250 SMTPUTF8
STARTTLS
220 2.0.0 SMTP server ready
schannel: failed to receive handshake, SSL/TLS connection failed
Closing connection 23
schannel: shutting down SSL/TLS connection with smtp.office365.com port 587
Hostname smtp.office365.com was found in DNS cache
Trying xx.xx.x.xxx...
TCP_NODELAY set
Connected to smtp.office365.com (xx.xx.x.xxx) port 587 (#24)
220 SC1PR80CA0170.outlook.office365.com Microsoft ESMTP MAIL Service ready at Mon, 27 Mar 2023 18:18:26 +0000
EHLO BULP05N020
250-SC1PR80CA0170.outlook.office365.com Hello [xxx.xxx.xx.x]
250-SIZE 157286400
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-STARTTLS
250-8BITMIME
250-BINARYMIME
250-CHUNKING
250 SMTPUTF8
STARTTLS
220 2.0.0 SMTP server ready
schannel: failed to receive handshake, SSL/TLS connection failed
Closing connection 24
schannel: shutting down SSL/TLS connection with smtp.office365.com port 587

I read in another forum, and maybe the problem is the Outlook configuration, with TLS/StartTLS authentication, but I didn't find the solution.
What do you think of this problem?

Thank for you time

Hi @Sanotarro,

This seems like a general IT problem rather than something specific to {emayili}. But let's see if we can help you.

Are you able to reach the server? What happens when you run the following from a terminal?

telnet smtp.office365.com 587

If you get output like this then it means that you are able to connect directly to the SMTP server on port 587.

Trying 40.99.201.226...
Connected to outlook.ha.office365.com.
Escape character is '^]'.
220 LO4P265CA0178.outlook.office365.com Microsoft ESMTP MAIL Service ready at Tue, 28 Mar 2023 06:11:52

Regards, Andrew.