Guest User

Untitled

a guest
Feb 16th, 2019
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. const nodemailer = require("nodemailer");
  2. const promisify = require("es6-promisify");
  3.  
  4. const transport = nodemailer.createTransport({
  5. service: 'gmail',
  6. auth: {
  7. user: "my gmail",
  8. pass: "my password"
  9. }
  10. });
  11.  
  12. exports.send = async options => {
  13. const mailOptions = {
  14. from: options.email,
  15. to: 'adikosh10@gmail.com',
  16. subject: options.subject,
  17. html: options.text,
  18. text: options.text
  19. };
  20.  
  21. const sendMail = promisify(transport.sendMail, transport);
  22. return sendMail(mailOptions);
  23. };
Add Comment
Please, Sign In to add comment