Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const nodemailer = require("nodemailer");
- const promisify = require("es6-promisify");
- const transport = nodemailer.createTransport({
- service: 'gmail',
- auth: {
- user: "my gmail",
- pass: "my password"
- }
- });
- exports.send = async options => {
- const mailOptions = {
- from: options.email,
- to: 'adikosh10@gmail.com',
- subject: options.subject,
- html: options.text,
- text: options.text
- };
- const sendMail = promisify(transport.sendMail, transport);
- return sendMail(mailOptions);
- };
Add Comment
Please, Sign In to add comment