Nodemailer Error: read ECONNRESET

Hi, i'm using a library called 'react email' with next 12, nodemailer and an outlook email. I try to send a simple email, but get this error: "Something went wrong :/ Error: read ECONNRESET". This is my code (all sensitive info is hidden):
import { render } from '@react-email/render';
import nodemailer from 'nodemailer';
import Email from './templates/test';

export default async function sendEmail() {
const transporter = nodemailer.createTransport({
host: 'smtp-mail.outlook.com',
port: 587,
secure: true,
auth: {
user: '...@outlook.com',
pass: '...',
},
});

const emailHtml = render(<Email />);

const options = {
from: '...@outlook.com',
to: '.@outlook.com',
subject: 'hello world',
html: emailHtml,
};

await transporter.sendMail(options);
}
import { render } from '@react-email/render';
import nodemailer from 'nodemailer';
import Email from './templates/test';

export default async function sendEmail() {
const transporter = nodemailer.createTransport({
host: 'smtp-mail.outlook.com',
port: 587,
secure: true,
auth: {
user: '...@outlook.com',
pass: '...',
},
});

const emailHtml = render(<Email />);

const options = {
from: '...@outlook.com',
to: '.@outlook.com',
subject: 'hello world',
html: emailHtml,
};

await transporter.sendMail(options);
}
0 Replies
No replies yetBe the first to reply to this messageJoin