1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import nodemailer from "npm:nodemailer";
const transport = nodemailer.createTransport({
host: "sandbox.smtp.mailtrap.io",
port: 2525,
auth: {
user: Deno.env.get("email_user"),
pass: Deno.env.get("email_pass"),
},
});
const options = {
from: "you@example.com",
};
export function sendMail(to, subject, html) {
transport.sendMail({ ...options, to, subject, html });
console.log(`email sent to ${to}`);
}