Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. //npm install nodemailer
  2. var nodemailer = require('nodemailer');
  3.  
  4. var transporter = nodemailer.createTransport({
  5. service: 'gmail',
  6. auth: {
  7. user: 'ahitisham.j2ee@gmail.com',
  8. pass: '05361269081'
  9. }
  10. });
  11.  
  12. var mailOptions = {
  13. from: 'ahitisham.a@gmail.com',
  14. to: 'zameer1409@gmail.com',
  15. subject: 'hey this is sending mail from me',
  16. text: 'That was easy!'
  17. };
  18.  
  19. transporter.sendMail(mailOptions, function(error, info){
  20. if (error) {
  21. console.log(error);
  22. } else {
  23. console.log('Email sent: ' + info.response);
  24. }
  25. });
  26. //folder$ node email.js
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement