banyucenter

Untitled

Nov 5th, 2018
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var nodemailer = require('nodemailer');
  2.  
  3. var transporter = nodemailer.createTransport({
  4.   service: 'gmail',
  5.   auth: {
  6.     user: '[email protected]',
  7.     pass: 'yourpassword'
  8.   }
  9. });
  10.  
  11. var mailOptions = {
  12.   from: '[email protected]',
  13.   subject: 'Sending Email using Node.js',
  14.   text: 'That was easy!'
  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