A custom action that utilizes nodemailer to send mails.
const nodemailer = require('nodemailer'); | |
async function main() { | |
let testAccount = await nodemailer.createTestAccount(); | |
let transporter = nodemailer.createTransport({ | |
host: 'smtp.ethereal.email', | |
port: 587, | |
secure: false, // true for 465, false for other ports | |
auth: { | |
user: testAccount.user, // generated ethereal user | |
pass: testAccount.pass, // generated ethereal password | |
} | |
}); | |
let usermessage = "This is email body example"; | |
// Create a message object | |
let message = { | |
from: 'Freeman <freeman24@ethereal.email>', | |
to: 'abhisheksimon@aabingunz.com, mbrown@gmail.com', | |
subject: 'This is your email Subject', | |
text: 'This is your email body Message: \t'+usermessage}; | |
// Sending message | |
transporter.sendMail(message); | |
} | |
main().catch(console.error); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment