Guest User

Untitled

a guest
Nov 23rd, 2017
414
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. var nodemailer = require('nodemailer');
  2.  
  3. var transporter = nodemailer.createTransport({
  4. service: 'gmail',
  5. auth: {
  6. pass: 'Qwerty123!'
  7. }
  8. });
  9.  
  10. var mailOptions = {
  11. // to: '[email protected], [email protected]', // send to multiple users
  12. subject: 'Sending email using Node.js',
  13. text: 'That was easy!!'
  14. // html: '<h1>Welcome</h1><p>That was easy!</p>' //send HTML formatted text in your email
  15. };
  16.  
  17. transporter.sendMail(mailOptions, function (error, info) {
  18. if (error) {
  19. console.log(error);
  20. } else {
  21. console.log('Email sent: ' + info.response);
  22. }
  23. });
Add Comment
Please, Sign In to add comment