I have install postfix with default parameters as Internet site, nodemailer package into my node.js server. And trying to do this:
var transporter = nodemailer.createTransport({
host: '127.0.0.1',
port: 25,
// auth: {
// user: user,
// pass: pass
// },
secure: false,
tls:{
rejectUnauthorized: false
}
});
I dont know what is username and password, I did not set it.
transporter.sendMail({
from: '"Mysite.com" <robot@mysite.com>', // sender address
to: user.email, // list of receivers
subject: "Your password for mysite.com", // Subject line
html: html // html body
}, (err) => {console.log('mail send error', err)});
In tail -f /var/log/mail.log I see this
Jan 30 01:00:04 80523 postfix/smtpd[26772]: connect from localhost[127.0.0.1]
Jan 30 01:00:04 80523 postfix/smtpd[26772]: lost connection after EHLO from localhost[127.0.0.1]
Jan 30 01:00:04 80523 postfix/smtpd[26772]: disconnect from localhost[127.0.0.1] ehlo=2 starttls=1 commands=3
And mail is not sent...
But if I use command echo "First message" | mutt -s "msg" mymail@mail.ru
, mail sent add I receive it.
Some ideas why?