Skip to content

Instantly share code, notes, and snippets.

@gbielecki
Created January 26, 2018 15:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gbielecki/5e60743b7e3f0b7c4b122ee3db495007 to your computer and use it in GitHub Desktop.
Save gbielecki/5e60743b7e3f0b7c4b122ee3db495007 to your computer and use it in GitHub Desktop.
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