Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const nodemailer = require('nodemailer');
- const transporter = nodemailer.createTransport({
- host: 'smtp.office365.com',
- port: 587,
- auth: {
- user: 'app.coordinator@somecompany.com',
- pass: 'XXXX',
- },
- });
- const sendEmail = (html, subject) => {
- const mailOptions = {
- from: 'app.coordinator@somecompany.com',
- to: 'some.user@somecompany.com',
- subject,
- html: 'test',
- };
- transporter.sendMail(mailOptions, (err) => {
- if (err) {
- console.log(`Error sending email ${err}`);
- return;
- }
- console.log('Email sent');
- });
- };
- sendEmail('htmlResponse', 'App coordinator - IGNORE: THIS IS A TEST Error notification');
Add Comment
Please, Sign In to add comment