Kalle KuhlmannK
Denoβ€’15mo agoβ€’
3 replies
Kalle Kuhlmann

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();


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
Was this page helpful?