mirror of
https://github.com/oven-sh/bun
synced 2026-02-12 11:59:00 +00:00
21 lines
636 B
JavaScript
21 lines
636 B
JavaScript
const nodemailer = require("nodemailer");
|
|
const transporter = nodemailer.createTransport({
|
|
host: "smtp.mailgun.org",
|
|
port: 587,
|
|
secure: false,
|
|
auth: {
|
|
user: process.env.SMTP_MAILGUN_USER,
|
|
pass: process.env.SMTP_MAILGUN_PASS,
|
|
},
|
|
});
|
|
|
|
// send mail with defined transport object
|
|
let info = await transporter.sendMail({
|
|
from: process.env.SMTP_MAILGUN_TO_FROM, // sender address
|
|
to: process.env.SMTP_MAILGUN_TO_FROM, // list of receivers
|
|
subject: "Hello ✔", // Subject line
|
|
text: "Hello world?", // plain text body
|
|
html: "<b>Hello world?</b>", // html body
|
|
});
|
|
console.log(typeof info?.messageId === "string");
|