I have new user registration once i get user detail from client i am sending email to group to grant permission to user , Below code is throwing exception any idea what is implemented wrong ?
I have pasted error in question.
Mailer.js
var nodemailer = require('nodemailer');
var smtpTransport = require('nodemailer-smtp-transport');
var MAIL_SERVER_URL = '127.0.0.0';
//establish the transporter
var transporter = nodemailer.createTransport(smtpTransport({
host: MAIL_SERVER_URL,
port: 80,
connectionTimeout: 60000,
}));
var Mailer = {
options: function (mailOptions) {
mailOptions.to = '[email protected]';
mailOptions.text = mailOptions.auid + ''+ 'requested access for modeler';
console.log('mailOptions',mailOptions);
transporter.sendMail(mailOptions, function(error, info) {
if (error) {
return console.log(error);
} else {
console.log('Message sent: ' + info.response);
}
});
}
}
module.exports = Mailer;
Error
{ [Error: connect EACCES 127.0.0.0:25]
code: 'ECONNECTION',
errno: 'EACCES',
syscall: 'connect',
address: '127.0.0.0',
port: 80,
command: 'CONN' }
Your error output is telling you that
nodemailer
cannot access the SMTP server at127.0.0.0
on port 25.Your implementation of nodemailer using SMTP looks good assuming the mailOptions getting passed in has a
from
property. You can read more about SMTP through nodemailer in the docs.