Advertisement
Guest User

Untitled

a guest
Jun 12th, 2017
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. const nodemailer = require('nodemailer');
  2. var conf = require(__dirname+'/conf');
  3.  
  4. // create reusable transporter object using the default SMTP transport
  5. let transporter = nodemailer.createTransport( {
  6. host: 'smtp.office365.com',
  7. port: 587,
  8. secureConnection: false,
  9. tls: {
  10. ciphers:'SSLv3'
  11. },
  12. auth: {
  13. user: conf.user,
  14. pass: conf.pass
  15. }
  16. });
  17.  
  18. // setup email data with unicode symbols
  19. let mailOptions = {
  20. from: '"Mark" <mark4427@stud.kea.dk>', // sender address
  21. to: 'hansenbm2650@gmail.com', // list of receivers
  22. subject: 'Hello ✔', // Subject line
  23. text: 'Hello world ?', // plain text body
  24. html: '<b>Hello world ?</b>' // html body
  25. };
  26.  
  27. // send mail with defined transport object
  28. transporter.sendMail(mailOptions, (error, info) => {
  29. if (error) {
  30. return console.log(error);
  31. }
  32. console.log('Message %s sent: %s', info.messageId, info.response);
  33. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement