Questions tagged [nodemailer]

Easy to use module to send e-mails with Node.JS

Nodemailer is an easy to use module to send e-mails with Node.JS (using SMTP or sendmail or Amazon SES) and is unicode friendly.

Nodemailer is Windows friendly, you can install it with npm on Windows just like any other module, there are no compiled dependencies. Use it from Azure or from your Windows box hassle free.

Installation:-

Install through NPM

npm install nodemailer

Useful Links:

2466 questions
18
votes
2 answers

How to send emails with google using nodemailer after Google disabled less sure app option?

I would like to find a way to send email from my app using nodemailer to the users either with some kind of google authentication or any other way. Below mentioned working code has stopped working after Google has disabled less secure app…
18
votes
5 answers

mock nodemailer.createTransport.sendMail with jest

I have some code which uses the nodemailer module. In the router (router.js), I have const transporter = nodeMailer.createTransport(emailArgs); Then inside the route (/login) I have: ... return transporter.sendMail(mailOptions); I'm trying to test…
Daniel Kats
  • 5,141
  • 15
  • 65
  • 102
18
votes
2 answers

How to define custom domain email in nodemailer?

I'm trying to send email using Nodejs package Nodemailer, but i'm unable to change the from email to my custom domain email. Any help will be appreciated. here is the code i'm using to send an email. transporter.sendMail({ from:…
Zeshan Virk
  • 183
  • 1
  • 1
  • 7
18
votes
2 answers

Sending ejs template using nodemailer

I'm trying to build a web application using express.js. In my application, I'm using nodemailer for sending mail. If I just use it to send basic mail it work ok; however, when I try to use nodemailer to send a rendered ejs file, the recipient only…
Blue Bird
  • 183
  • 1
  • 1
  • 4
17
votes
1 answer

Error: self signed certificate in certificate chain Nodejs nodemailer express

So I'm doing this app in Node.js with express and I have this error Error: self signed certificate in certificate chain at Error (native) at TLSSocket. (_tls_wrap.js:1092:38) at emitNone (events.js:86:13) at TLSSocket.emit…
user2758290
17
votes
1 answer

Mail messages sent from nodemailer are not showing in user mail sent box

I am sending messages from my domain account but they are not showing in user(from options of nodemailer) sent box.But when sending messages from gmail service messages are showing in sent box of user.Am I missing something in below code? var…
Sunil Yadav
  • 171
  • 1
  • 5
16
votes
2 answers

Nodemailer email confirmation using Async/Await

I am sending mails using nodemailer. I need to know if the mail is sent or not and then update my database but the mail is sent in the transporter(which I do not think returns promises) which takes time and hence the return is always false, even if…
Abdul Ahad
  • 1,221
  • 2
  • 16
  • 28
16
votes
2 answers

SendGrid-nodejs or Nodemailer?

There are at least two ways to send email from Nodejs using SendGrid: Sendgrid provides a Nodejs library called "SendGrid-nodejs." They're actively supporting Sendgrid-Nodejs (last update 29 days ago). Nodemailer supports sendgrid and seems to be…
stone
  • 8,422
  • 5
  • 54
  • 66
15
votes
1 answer

Sending links to email with nodemailer not working

I'm working on an app and I'm using nodemailer to send recovery emails for users to reset their passwords and I'm trying to send a link to a page that will allow them to change their password. I'm using the following for the body of the email…
jmona789
  • 2,711
  • 6
  • 24
  • 57
15
votes
8 answers

Nodemailer: ECONNREFUSED

I don't know what I'm missing, I use the Nodemailer example: var nodemailer = require("nodemailer"); // create reusable transport method (opens pool of SMTP connections) var smtpTransport = nodemailer.createTransport("SMTP",{ service: "Gmail", …
user1756980
  • 3,807
  • 4
  • 16
  • 13
14
votes
7 answers

Nodemailer in vercel not sending email in production

I'm using Nodemailer to send emails in my serverless Next.js project, deployed in Vercel, which works perfectly in development mode. But I'm having problems in production. No error returned, everything works the same way as is development mode,…
Daniel Ioanitescu
  • 187
  • 1
  • 1
  • 10
14
votes
1 answer

Next.JS and Nodemailer, Sending an email from contact form

I have a problem with my contact form in next.js, I don't have any errors (that are shown), everything worked untill deployment (on Vercel). I fetch my form, and have status 200, but I do not recive my email on Gmail. Also I don't recive any…
Maciej
  • 143
  • 1
  • 1
  • 6
14
votes
5 answers

Email opened/not tracking from nodejs nodemailer

What I know I want to implement the email opened/not tracking in one of my websites. after searching i found that email-opened/not tracking is done by sending an embedded image along with email(typically 1 px transparent). when some one opens the…
raj
  • 694
  • 1
  • 5
  • 22
14
votes
6 answers

Nodemailer with Gmail service not working on heroku

I've got a basic email setup done for sending an email using Nodemailer with AngularJS and NodeJS and I've got the project deployed on heroku. The emailing seems to be working just fine when I am running the app on heroku, but when I get it deployed…
skip
  • 12,193
  • 32
  • 113
  • 153
13
votes
1 answer

Nodemailer - MS Exchaneg server - Error unable to verify the first certificate

I am trying to send email from NodeJS using out office MS Exchange Mail server. with below code. And get error Our Admin said no certificates are needed. Error:- $ node test2.js Error : { Error: unable to verify the first certificate at…
Jay
  • 9,189
  • 12
  • 56
  • 96