Ari Porad Ari Porad - 5 months ago 41
Node.js Question

Nodemailer error: [Error: No transport method defined]

I am using nodemailer with sendgrid and i am getting the error :

[Error: No transport method defined]


I am setting up the transport like so:

var email = nodemailer.createTransport("STMP", {
service: "Sendgrid",
auth: {
user: "username",
pass: "pass"
}
})

Answer

i Don't know what happend but I discovered some old code and used it. so the sulution was change :

 var email = nodemailer.createTransport("STMP", {
service: "Sendgrid",
auth: {
    user: "user",
    pass: "pass"
}
})

to

 var email = nodemailer.createTransport("SMTP", {
service: "SendGrid",
auth: {
    user: "user",
    pass: "pass"
}
});