Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Send email nodemailer from Outlook365 erro [duplicate]

I'm using the firebase function to trigger the nodemailer and send an email.

Using gmail I was successful, however with Outlook365 it does not work.

My transporter

var transporter = nodemailer.createTransport(smtpTransport({
host: 'outlook.office365.com',
port: 25,
secure: true, // use TLS
auth: {
    user: 'myuser',
    pass: 'pass'
},
tls: {
    // do not fail on invalid certs
    rejectUnauthorized: false
}}));

I have tried other ports, using the service: "Outlook365", but I did not succeed.

The console always returns me the following error

Error: getaddrinfo ENOTFOUND outlook.office365.com outlook.office365.com:587
at errnoException (dns.js:28:10)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:76:26)
code: 'ECONNECTION',
errno: 'ENOTFOUND',
syscall: 'getaddrinfo',
hostname: 'outlook.office365.com',
host: 'outlook.office365.com',
port: 587,
command: 'CONN

thank's

like image 573
Leone Azevedo Avatar asked Oct 16 '25 17:10

Leone Azevedo


1 Answers

IMAP (incoming) -> outlook.office365.com -> Port 993 -> SSL

SMTP (outgoing) -> smtp.office365.com -> Port: 587 -> TLS

I think you have port configuration error look again into this. For more you can refer, Configuring Your Email Client for Office 365

like image 112
Nikhil Savaliya Avatar answered Oct 18 '25 05:10

Nikhil Savaliya



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!