+++ /dev/null
-const nodemailer = require('nodemailer');
-
-module.exports = function(email, subject, content, cb)
-{
- // create reusable transporter object using the default SMTP transport
- const transporter = nodemailer.createTransport({
- host: "smtp_host_address",
- port: 465, //if secure; otherwise use 587
- secure: true,
- auth: {
- user: "user_name",
- pass: "user_password"
- }
- });
-
- // setup email data with unicode symbols
- const mailOptions = {
- from: email, //note: some SMTP serves might forbid this
- to: "contact_email",
- subject: subject,
- text: content,
- };
-
- // send mail with defined transport object
- transporter.sendMail(mailOptions, (error, info) => {
- if (!!error)
- return cb(error);
- // Ignore info. Option:
- //console.log('Message sent: %s', info.messageId);
- return cb();
- });
-};