Advertisement
Guest User

Untitled

a guest
Aug 3rd, 2017
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. var nodemailer = require('nodemailer');
  2.  
  3. var transporter = nodemailer.createTransport({
  4. service: 'gmail',
  5. port:'465',
  6. secure: 'false',
  7. auth: {
  8. user: 'my_id',
  9. pass: 'my_password'
  10. },
  11. tls: {
  12. rejectUnauthorized: false
  13. }
  14. });
  15.  
  16. var mailOptions = {
  17. from: 'myemail',
  18. to: receiver's email,
  19. subject: "some text",
  20. text: "some text"
  21. };
  22.  
  23. transporter.sendMail(mailOptions, function(error, info){
  24. if (error) {
  25. console.log(error);
  26. } else {
  27. console.log('Email sent: ' + info.response);
  28. }
  29. });
  30.  
  31. { Error: connect ECONNREFUSED 74.125.124.109:465
  32. at Object.exports._errnoException (util.js:1026:11)
  33. at exports._exceptionWithHostPort (util.js:1049:20)
  34. at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1085:14)
  35. code: 'ECONNECTION',
  36. errno: 'ECONNREFUSED',
  37. syscall: 'connect',
  38. address: '74.125.124.109',
  39. port: 465,
  40. command: 'CONN' }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement