I'm trying to use nodemailer in a Cloud Functions for Firebase but keep getting errors seeming to be that the smpt server cant be reached or found. Iv'e tried gmail, outlook and a normal hosted smpt service. It works well from my local node server.
This is the logged error I receive from the failed attempt to send email:
{
Error: getaddrinfoENOTFOUNDsmtp-mail.outlook.comsmtp-mail.outlook.com: 587aterrnoException(dns.js: 28: 10)atGetAddrInfoReqWrap.onlookup[
asoncomplete
](dns.js: 76: 26)code: 'ECONNECTION',
errno: 'ENOTFOUND',
syscall: 'getaddrinfo',
hostname: 'smtp-mail.outlook.com',
host: 'smtp-mail.outlook.com',
port: '587',
command: 'CONN'
}
I created a cloud function (http event) to send emails from the contact form section of my site with the following way: