import * as nodemailer from 'nodemailer'
export interface Smtp {
host: string;
port: number;
user: string;
password: string;
}
export async function main(
smtp: Smtp,
from: string,
to: string,
subject: string,
data: string
) {
const transport = nodemailer.createTransport({
host: smtp.host,
port: smtp.port,
auth: {
user: smtp.user,
pass: smtp.password
}
})
const result = await transport.sendMail({
from,
to,
html: data,
subject
});
return result;
}
Submitted by aurélien brabant550 458 days ago