Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
dasilv32/temp.js
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
20 lines (17 sloc)
507 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const mailer = require('nodemailer-promise') | |
const config = require('./config.json') | |
async function main() { | |
try { | |
const sendEmail = mailer.config(config) | |
const message = { | |
from: 'sender@email.com', // sender address | |
to: 'marktyers@gmail.com', // list of receivers | |
subject: 'Subject of your email', // Subject line | |
html: '<p><a href="google.com">Your html here</a></p>'// plain text body | |
} | |
await sendEmail(message) | |
} catch (err) { | |
console.log(`error: ${err.message}`) | |
} | |
} | |
main() |