Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const nodemailer = require('nodemailer');
- var conf = require(__dirname+'/conf');
- // create reusable transporter object using the default SMTP transport
- let transporter = nodemailer.createTransport( {
- host: 'smtp.office365.com',
- port: 587,
- secureConnection: false,
- tls: {
- ciphers:'SSLv3'
- },
- auth: {
- user: conf.user,
- pass: conf.pass
- }
- });
- // setup email data with unicode symbols
- let mailOptions = {
- from: '"Mark" <mark4427@stud.kea.dk>', // sender address
- to: 'hansenbm2650@gmail.com', // list of receivers
- subject: 'Hello ✔', // Subject line
- text: 'Hello world ?', // plain text body
- html: '<b>Hello world ?</b>' // html body
- };
- // send mail with defined transport object
- transporter.sendMail(mailOptions, (error, info) => {
- if (error) {
- return console.log(error);
- }
- console.log('Message %s sent: %s', info.messageId, info.response);
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement