SHARE
TWEET

Untitled

a guest Jul 21st, 2017 438 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.     host: 'smtp.qq.com',
  5.     secureConnection: true,
  6.     port: 25,
  7.     auth: {
  8.         user: '944473232@qq.com',
  9.         pass: '***' //授权码
  10.     }
  11. });
  12.  
  13. var mailOptions = {
  14.     from: '944473232@qq.com', // sender address
  15.     to: 'Jake_Laoyu@163.com', // list of receivers
  16.     subject: 'Hello ✔', // Subject line
  17.     text: 'Hello world ✔', // plaintext body
  18.     html: '<b>Hello world ✔</b>' // html body
  19. };
  20.  
  21.  
  22. transporter.sendMail(mailOptions, function(error, info) {
  23.     if (error) {
  24.         console.log(error);
  25.     } else {
  26.         console.log('Message sent: ' + info.response);
  27.     }
  28. });
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