Guest User

Untitled

a guest
Nov 23rd, 2017
411
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. user: 'arjunemail007@gmail.com',
  7. pass: 'Qwerty123!'
  8. }
  9. });
  10.  
  11. var mailOptions = {
  12. from: 'arjunmail007@gmail.com',
  13. to: 'gaurang151091@gmail.com',
  14. // to: 'myfriend@yahoo.com, myotherfriend@yahoo.com', // send to multiple users
  15. subject: 'Sending email using Node.js',
  16. text: 'That was easy!!'
  17. // html: '<h1>Welcome</h1><p>That was easy!</p>' //send HTML formatted text in your email
  18. };
  19.  
  20. transporter.sendMail(mailOptions, function (error, info) {
  21. if (error) {
  22. console.log(error);
  23. } else {
  24. console.log('Email sent: ' + info.response);
  25. }
  26. });
Add Comment
Please, Sign In to add comment