Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // main.js
- const nodemailer = require('nodemailer');
- // setup mail transporter service
- const transporter = nodemailer.createTransport({
- service: 'hotmail',
- auth: {
- user: 'yourmail@hotmail.com', // your email
- pass: 'password' // your password
- }
- });
- // setup email data with unicode symbols
- const mailOptions = {
- from: 'sender@hotmail.com', // sender
- to: 'receiver@hotmail.com', // list of receivers
- subject: 'Hello from sender', // Mail subject
- html: '<b>Do you receive this mail?</b>' // HTML body
- };
- // send mail with defined transport object
- transporter.sendMail(mailOptions, function (err, info) {
- if(err)
- console.log(err)
- else
- console.log(info);
- });
Add Comment
Please, Sign In to add comment