Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
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: '',
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 <>',
to: ',',
subject: 'This is your email Subject',
text: 'This is your email body Message: \t'+usermessage};
// Sending message
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment