Guest User

Untitled

a guest
Nov 30th, 2018
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. app.intent('sendMail', (conv, params) => {
  2. const nodemailer = require('nodemailer');
  3. const transporter = nodemailer.createTransport({
  4. service: 'gmail',
  5. auth: {
  6. user: 'youremail@gmail.com',
  7. pass: 'yourPassword'
  8. }
  9. });
  10.  
  11. var mailOptions = {
  12. from: 'youremail@gmail.com',
  13. to: email, //receiver email
  14. subject: 'Mail subject',
  15. text: 'mail body'
  16. };
  17.  
  18. transporter.sendMail(mailOptions, function (error, info) {
  19. if (error) {
  20. console.log(error);
  21. } else {
  22. console.log('Email sent: ' + info.response);
  23. }
  24. });
  25.  
  26.  
  27. });
Add Comment
Please, Sign In to add comment