Amila Iddamalgoda Amila Iddamalgoda - 1 year ago 165
Node.js Question

Node.js + Nodemailer + Sending mail through ipage smtp

I need to send emails to my clients using ipage email address through my node.js app. Currently, I'm using as the node module. Following will be my code. I'm getting a Connection timeout error as the err. Is there anything I missed? Any tips or insights on this ? Please help me out.

enter image description here

Answer Source

Its beacuse the credentials you are passing in

var transporter = nodemailer.createTransport();

are not completed.

Here is an example of the fields you can pass.

var transporter = nodemailer.createTransport(smtpTransport ({
        auth: {
            user: config.EMAIL.EMAIL.USER,
            pass: config.EMAIL.EMAIL.PASS
        host: config.EMAIL.HOST,
        secureConnection: config.EMAIL.SECURECONNECTION,
        port: config.EMAIL.PORT,
        tls: {
            rejectUnauthorized: config.EMAIL.TLS.REJECTUNAUTHORIZED

Here i have stored my credentials in my config file, you can pass them directly here.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download