I’m trying to send confirmation emails using an Outlook SMTP server and Nodemailer. In local environment, it’s working fine. However, I’m getting this error when trying to send email from deployed app:
Error sending email: Error: connect ECONNREFUSED 127.0.0.1:587
Jun 24 01:58:28 PM at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1494:16) {
Jun 24 01:58:28 PM errno: -111,
Jun 24 01:58:28 PM code: 'ESOCKET',
Jun 24 01:58:28 PM syscall: 'connect',
Jun 24 01:58:28 PM address: '127.0.0.1',
Jun 24 01:58:28 PM port: 587,
Jun 24 01:58:28 PM command: 'CONN'
Jun 24 01:58:28 PM }
Any pointers would be appreciated!