SHARE
TWEET

Untitled

banyucenter Nov 5th, 2018 52 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: 'youremail@gmail.com',
  7.     pass: 'yourpassword'
  8.   }
  9. });
  10.  
  11. var mailOptions = {
  12.   from: 'youremail@gmail.com',
  13.   to: 'myfriend@yahoo.com',
  14.   subject: 'Sending Email using Node.js',
  15.   text: 'That was easy!'
  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. });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top