1
0
Fork 0
mirror of https://github.com/kou029w/_.git synced 2025-01-30 22:08:02 +00:00
_/nodemailer/index.mjs
2023-08-23 10:31:52 +09:00

20 lines
415 B
JavaScript

import nodemailer from "nodemailer";
const transporter = nodemailer.createTransport({
host: "localhost",
port: 1025,
secure: false,
auth: {
user: "postmaster",
pass: "password",
},
});
const info = await transporter.sendMail({
from: "foo <foo@example.com>",
to: "bar <bar@example.com>",
subject: "Hello world!",
html: "<marquee>Hello world.</marquee>",
});
console.log(info.messageId);