Created
January 26, 2018 15:49
-
-
Save gbielecki/5e60743b7e3f0b7c4b122ee3db495007 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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