Instantly share code, notes, and snippets.

Embed
What would you like to do?
import nodemailer from "nodemailer";
function setup() {
return nodemailer.createTransport({
host: 'smtp.mailtrap.io',
port: 2525,
auth: {
user: '82c2a63f7c2386',
pass: '8ebe1c2712bb52'
}
});
}
export function sendConfirmationEmail(emailTo, emailSubject, emailText) {
const transport = setup();
const email = {
from: '"mailtrap" <test@test.com>',
to: emailTo,
subject: emailSubject,
text: emailText
};
transport.sendMail(email);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment