Jitendra Kumar
Jitendra Kumar

Reputation: 640

How to use nodemailer to send mail from a node js app

I am creating a web app on node js and jquery. In this app i am using Nodemailer to send emails when use create an account. Right now i am using

var transport = nodemailer.createTransport("SMTP", {
    service: "Gmail",
    auth: {
        user: "[email protected]",
        pass: "abcpws"
    }
});

This is working well. But Now i want to change sender email like [email protected]. Now my email is [email protected] which is created on (hostgator).

What should i do to use this email to send mail.

Upvotes: 0

Views: 1066

Answers (1)

Ivan Rios
Ivan Rios

Reputation: 46

You need to configure the transporter with the SMTP parameters:

var transport = nodemailer.createTransport({
    host      : 'mail.domain.com',
    port      : 26,
    ignoreTLS: true,
    tls :{rejectUnauthorized: false},
    secure :false,
    auth: {
        user: '[email protected]',
        pass: "123",
    }
});

Upvotes: 3

Related Questions