multiple-email-service
Version:
It's helps developer to use multiple email service from this package.
16 lines (14 loc) • 372 B
JavaScript
const api_key = 'key-3ax6xnjp29jd6fds4gc373sgvjxteol0';
const domain = 'smtp.gmail.com';
const mailgun = require('mailgun-js')({apiKey: api_key, domain: domain});
exports.sendEmail = async (from, to, subject, body) => {
const data = {
from,
to,
subject,
text
};
mailgun.messages().send(data, function (error, body) {
console.log(body);
});
}