mirror of
https://github.com/kou029w/_.git
synced 2025-01-30 22:08:02 +00:00
20 lines
415 B
JavaScript
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);
|