Firebase function nodemailer Office365

2

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

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

In the transporter I do it this way:

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

I've tried other ports, using service: "Outlook365" , but I did not succeed.

The console 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' 

Thanks in advance for your help.

    
asked by anonymous 09.01.2018 / 14:00

0 answers