Reputation: 21
I have a problem on sending mails online.net with nodemailer. While it works fine with chilkat's mailman module (node.js) on the same environment
nodemailer version
let transporter = nodemailer.createTransport({
host: "smtpauth.online.net",
port: 587,
secure: false,
auth: {
user: "[email protected]",
pass: "xxx",
},
tls: {
rejectUnauthorized: false,
},
});
transporter
.sendMail({
from: "[email protected]",
to: "[email protected]",
subject: "Test online",
text: "Test online"
})
.then((info) => {
console.log("Preview URL: " + nodemailer.getTestMessageUrl(info));
})
.catch((error) => {
console.log(error);
});
chilkat-version
var mailman = new chilkat.MailMan();
mailman.SmtpHost = "smtpauth.online.net";
mailman.SmtpUsername = "[email protected]";
mailman.SmtpPassword = "xxx";
mailman.SmtpSsl = false;
mailman.StartTLS = true;
mailman.SmtpPort = 587;
var email = new chilkat.Email();
email.Subject = "Test online";
email.Body = "Test online";
email.From = "[email protected]";
var success = email.AddTo("Bob","[email protected]");
success = mailman.SendEmail(email);
if (success !== true) {
console.log(mailman.LastErrorText);
return;
}
success = mailman.CloseSmtpConnection();
if (success !== true) {
console.log("Connection to SMTP server not closed cleanly.");
}
console.log("Mail Sent!");
Following the scaleway doc (https://www.scaleway.com/en/docs/webhosting/classic/how-to/check-emails/), I tried all ports (25, 465, 587, 2525 ). I changed the host from smtpauth.online.net to smtp.online.net, nothing helped.
If anyone has solved this problem that would be a great help. Thanks
Upvotes: 0
Views: 462
Reputation: 21
I found the solution.
it works by adding "name" option in createTransport
name – optional hostname of the client, used for identifying to the server, defaults to hostname of the machine
let transporter = nodemailer.createTransport({
name: 'www.domain.com',
host: "smtpauth.online.net",
port: 587,
secure: false,
auth: {
user: "[email protected]",
pass: "xxx",
},
tls: {
rejectUnauthorized: false,
},
});
Upvotes: 1