Using Nodemailer without a Well-Known email service

Started by ssmall, October 04, 2015, 01:11:45 PM

ssmall

If you would like to use your ISP's email server instead of Gmail or the like here is how to set up Nodemailer to do that.

In settings.js modify the exports.credentials:

exports.credentials = {
  emailservice : 'gmail',                              // Default is gmail, see nodemailer reference for other clients - https://github.com/andris9/Nodemailer
  emailhost : 'ISP_Email_Server_Address',   // Your ISP's email server address
  port : 'ISP_Email_Server_Port_Numer',     // Your ISP's email server port
  email : 'ISP_Email_Address',                    // Put your ISP email address here
  emailpass : 'ISP_Email_Password',           // Put your ISP email password or app access code here
  emailAlertsTo : 'ISP_Email_Address',        // Put your alert/notification email here (can be the same as above)
  smsAlertsTo : 'SMS',                               // if you want SMS notifications, fill this in with your phone number (it's your cell#, domain differs for each carrier, ex: [email protected] for verizon)
};

In gateway.js modify the following from:

var transporter = nodemailer.createTransport({
    service: settings.credentials.emailservice, //"gmail" is preconfigured by nodemailer, but you can setup any other email client supported by nodemailer
    auth: {
        user: settings.credentials.email,
        pass: settings.credentials.emailpass,
    }
});


To the following:

var smtpTransport = require('nodemailer-smtp-transport');
var transporter = nodemailer.createTransport(smtpTransport({
    host: settings.credentials.emailhost,
    port: settings.credentials.port,
    auth: {
        user: settings.credentials.email,
        pass: settings.credentials.emailpass,
    }
}));