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
6
votes
2 answers

Nodemailer send emails using original user account instead of alias

I have a problem with nodemailer where the user receive the email with sent from my google account which used to authenticate gmail instead of the alias used in mail options. Below is my code: var smtpTransport = nodemailer.createTransport({ …
Dev
  • 1,861
  • 2
  • 14
  • 20
6
votes
2 answers

How can I attach an image to an email from an URL using nodemailer and request modules in node.js?

I'm new to javascript and node.js and trying to learn it by doing something useful. So, I want to send an email with an image as attachment. The image will be retrieved from a remote server by issuing HTTP GET request and send to an email address…
Ilya Khadykin
  • 290
  • 6
  • 14
6
votes
4 answers

How to use pdf output of PDFMake in the attachment mail options of NodeMailer?

Here is a one of PDFMake's code snippet to create pdf file: var pdfDoc = printer.createPdfKitDocument(docDefinition); pdfDoc.pipe(fs.createWriteStream('pdfs/absolute.pdf')); pdfDoc.end(); and here is one of the attachment option in NodeMailer: { …
Ritesh Jagga
  • 1,387
  • 1
  • 11
  • 23
6
votes
2 answers

Nodemailer not working on Amazon EC2 instance

I am EC2 instance up and running , I wanted to integrate nodemailer in my application. Following the https://www.npmjs.com/package/nodemailer I was able to send email from my localhost. When the same code I integrated on EC2 instance I am getting…
6
votes
2 answers

Heroku issue with NodeMailer

I am having an issue with Nodemailer on Heroku and I would really appreciate your help. A previous version of my application used to work on Heroku with no problem and when I roll back to that version, it still works fine. In the latest version of…
Gaj
  • 293
  • 2
  • 11
6
votes
1 answer

Closing a connection in nodemailer

I am using nodemailer to send e-mails in nodejs. I am able to send the mails, but the script doesn't terminate. I don't know how to close the connection. This is the code: var nodemailer = require('nodemailer'); nodemailer.SMTP = { host:…
Prachi g
  • 849
  • 3
  • 9
  • 23
6
votes
4 answers

NodeMailer attachments not sending with smtp/gmail

I created the following function with NodeMailer which seems to be despatching emails without problems ("Message sent" notification in console and email received) except there are no attachments with any emails sent! Tried it with a bunch of email…
socratic_singh
  • 183
  • 1
  • 13
6
votes
4 answers

How to fix TypeError: Cannot read property 'name' from Express Nodemailer

So I do want to say that I've been searching for the answer for this and I've also tried to console.log my req.body post form and I keep getting undefined. So I feel that I'm losing the data from the form I send, I'm not sure what I"m doing wrong.…
jemiloii
  • 24,594
  • 7
  • 54
  • 83
5
votes
1 answer

Trying to set up local docker-mailserver with docker-compose and nodemailer

I am trying to set up a docker-mailserver instance to use the nodemailer module to send emails from in my local dev setup. Here's what my docker-compose.yml file looks like: version: '3.1' services: postgres: container_name: postgres …
5
votes
5 answers

nodemailer Invalid login: 535 Authentication Failed

I'm trying to use nodemailer(npm package) in my node app to send email through the contact page. It is giving me this 535 Authentication Failed error while I can assure you that my email and password are absolutely correct. var express =…
Nishant Kumar
  • 691
  • 1
  • 11
  • 31
5
votes
1 answer

What is the return type of nodemailer's transporter.sendMail()?

I got this piece of code: import nodemailer from "nodemailer"; const transporter = nodemailer.createTransport({ host: "smtp...", port: 587, secure: false, requireTLS: true, auth: {...} }); const result = await transporter.sendMail({ …
cbdeveloper
  • 27,898
  • 37
  • 155
  • 336
5
votes
3 answers

nodemailer-express-handlebars | Error: ENOENT: no such file or directory for template

I am having an issue where nodemailer-express-handlebars is outputing the error: [Error: ENOENT: no such file or directory, open ''] { errno: -2, code: 'ENOENT', syscall: 'open', path:…
5
votes
0 answers

Send a silent email from RN Expo app without opening the email client

I’ve had a search around and can’t seem to find anything with the specifics of my question. I need to send an email silently from my RN Expo app to a fixed email address, so when the user clicks SEND it gets sent WITHOUT opening up the email…
LyonsTheWay2Gold
  • 363
  • 1
  • 11
5
votes
2 answers

Cannot start a mail thread (reply to a mail) using nodemailer (gmail)

I am using nodemailer to send emails. But I would like to send reply to a mail (start a new thread).I have tried sending reply to a mail using the below code var nodemailer = require('nodemailer'); const subject = 'Hey I am test'; var transporter…
Nikhil Ponduri
  • 409
  • 9
  • 28
5
votes
2 answers

NestJs email failed to send with ejs template dynamic data

I am trying to send email in Nestjs framework using @nestjs-modules/mailer nodemailer. Email are working fine with normal text but when is setup to use EJS template for email body its stoped working. I use…