1 year ago
#378295
BSmaster
Can't send any email with Nodemailer package in Node js
I'm trying to send an email from my Node js application with nodemailer package, but I'm getting an unexpected problem. I've just read several topic about the same problem and they worked for my gmail account, but actually I would like to use this service with an Aruba email. This is the interested piece of code:
const nodemailer = require('nodemailer');
//const smtpTransport = require('nodemailer-smtp-transport');
const config = require('./config.json');
const transporter = nodemailer.createTransport({
host: "smtps.aruba.it",
logger: true,
debug:true,
secure: true,
port: config.Mail.MAIL_PORT,
auth: {
user: config.Mail.MAIL_ADDRESS,
pass: config.Mail.MAIL_PASSWORD
},
tls:{
minVersion: 'TLSv1',
ciphers:'HIGH:MEDIUM:!aNULL:!eNULL:@STRENGTH:!DH:!kEDH'
}
});
let mailOptions = {
from: config.Mail.MAIL_ADDRESS,
to: config.Mail.MAIL_DEST,
subject: config.Mail.MAIL_CONFIRM_SIGIN_SUBJECT,
text: "Something"
};
transporter.sendMail(mailOptions, function(error, info){
if (error) {
console.log(error);
} else {
console.log('Email sent: ' + info.response);
}
});
The console output is this one:
{
code: 'EAUTH',
response: '535 5.7.0 bkvxnow6m4Pmf ...authentication rejected',
responseCode: 535,
command: 'AUTH PLAIN'
}
[2022-04-05 15:17:30] INFO [ljqdiec7p84] Connection closed
javascript
nodemailer
0 Answers
Your Answer