I used this setup to send a mail:
import NodeMailer from 'nodemailer'
import SmtpTransport from 'nodemailer-smtp-transport'
const transporter = NodeMailer.createTransport(SmtpTransport({
host: 'smtp.1blu.de',
port: 25,
debug: true,
auth: {
user: '...',
pass: '...'
}
}))
transporter.sendMail(options, (error, data) => ...)
But I get this error:
Error: connect ECONNREFUSED 127.0.0.1:25
at Object.exports._errnoException (util.js:749:11)
at exports._exceptionWithHostPort (util.js:772:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1009:14)
Seems like it ignores the host, but why?
I had the very same problem as you and I am using 1blu as well. The issue is related to the TLS library of Node. The following configuration did the job for me.
var smtpTransport = nodemailer.createTransport("SMTP",{
host: 'smtp.1blu.de',
secureConnection: true,
port: 465,
auth: {
user: '...',
pass: '...'
},
tls:{
secureProtocol: "TLSv1_method"
}
});
console.log('SMTP Configured');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With