Kalle Kuhlmann
Kalle Kuhlmann2mo ago

Nodemailer fails with Client network socket disconnected before... even locally

Hey, I am trying to use nodemailer within deno (2.0.4), and I am unable to figure out why it doesn't work. I made a minimal example (ethereal credentials specifically for this example):
import nodemailer from 'npm:nodemailer';

const testMail = async () => {
const transporter = nodemailer.createTransport({
host: "smtp.ethereal.email",
port: 587,
secure: false, // Use `true` for port 465, `false` for all other ports
auth: {
user: "tess3@ethereal.email",
pass: "K9S6HKVEg8bDtVNnnr",
},
logger: true,
});

return transporter.verify();
}

testMail();
import nodemailer from 'npm:nodemailer';

const testMail = async () => {
const transporter = nodemailer.createTransport({
host: "smtp.ethereal.email",
port: 587,
secure: false, // Use `true` for port 465, `false` for all other ports
auth: {
user: "tess3@ethereal.email",
pass: "K9S6HKVEg8bDtVNnnr",
},
logger: true,
});

return transporter.verify();
}

testMail();
This fails with Client network socket disconnected before secure TLS connection was established independent of the "secure" setting. If I run this same snipped with node, there is no problem. Does somebody have an idea? Best, Kalle
3 Replies
bartlomieju
bartlomieju2mo ago
Could you please open an issue on Deno's GitHub? This seems like a bug in Deno
Kalle Kuhlmann
Kalle KuhlmannOP2mo ago
Sure. I'll do tomorrow as soon as I am on the pc
bartlomieju
bartlomieju2mo ago
Thanks!