Advertisement
Guest User

Untitled

a guest
Oct 20th, 2016
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. var nodemailer = require('nodemailer');
  2.  
  3. var mailerOptions = {
  4. transport: "SMTP",
  5. host: 'smtp.parser.cc',
  6. port: 587,
  7. secure: false,
  8. requireTLS: true,
  9. ignoreTLS:false,
  10. requiresAuth: true,
  11. authMethod:'NTLM',
  12. auth: {
  13. user: 'mailer@parser.cc',
  14. pass: '1246792942'
  15. },
  16. tls: {rejectUnauthorized: false},
  17. debug:true
  18. };
  19.  
  20. // create reusable transporter object using the default SMTP transport
  21. var transporter = nodemailer.createTransport(mailerOptions);
  22.  
  23. // setup e-mail data with unicode symbols
  24. var mailOptions = {
  25. from: '"Fred Foo 👥" <foo@blurdybloop.com>', // sender address
  26. to: '813920477@qq.com, wuxueqian2010@icloud.com, wuxueqian2010@hotmail.com, chinash2010@gmail.com', // list of receivers
  27. subject: 'Hello ✔', // Subject line
  28. text: 'Hello world 🐴', // plaintext body
  29. html: '<b>Hello world 🐴</b>' // html body
  30. };
  31.  
  32. // send mail with defined transport object
  33. transporter.sendMail(mailOptions, function(error, info){
  34. if(error){
  35. return console.log(error);
  36. }
  37. console.log('Message sent: ' + info.response);
  38. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement