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

Node.js nodemailer error - wrong version number/invalid greeting

I have a big problem with setting up the nodemailer on my node.js server. Tried everthing I found on the internet but nothing works. The only thing that was easy to setup was the gmail service. but unfortunately I cannot use that one. With secure…
Simon Schuster
  • 363
  • 1
  • 3
  • 5
25
votes
2 answers

What is the definitive way to use Gmail with OAuth and Nodemailer?

Desired Behaviour Use Gmail, OAuth2 and Nodemailer to send an email from a server side node.js file. What I've Tried Relevant…
user1063287
  • 10,265
  • 25
  • 122
  • 218
25
votes
1 answer

NodeMailer No Recipients Defined

When trying to send an email from a node.js server using nodemailer, I get the following error: ERROR: Send Error: No recipients defined My code is as follows: client side: var mailData = { from: "myemail@gmail.com", to:…
Samuel Pearsall
  • 445
  • 1
  • 5
  • 11
25
votes
3 answers

Sending emails using Mailgun with NodeMailer package

A couple of days ago I realized that Google has changed the security of gmail accounts, particularly for the possibility of sending emails from applications. After Googling around for a while I couldn't find a fix for it. So, I resorted to using…
joque
  • 813
  • 2
  • 9
  • 14
25
votes
8 answers

Not able to connect to outlook.com SMTP using Nodemailer

I am creating the transport object like this. var transport = nodemailer.createTransport("SMTP", { host: "smtp-mail.outlook.com", // hostname secureConnection: false, // use SSL port: 587, // port for secure SMTP …
Jeevan
  • 3,878
  • 6
  • 29
  • 37
24
votes
6 answers

Email send through nodemailer goes into spam for gmail

I am sending email through nodemailer it goes into inbox of gmail if i run from local server but goes into spam of gmail if i run script from microsoft azure server. following is my script var nodemailer = require('nodemailer'); var EmailTemplates =…
Rajesh N
  • 6,198
  • 2
  • 47
  • 58
24
votes
7 answers

NodeMailer Invalid Login

I am new to node.js programming .I am using nodemailer module for sending emails. const nodemailer = require ('nodemailer'), credentials=require('./credentials.js'); var mailTransport=nodemailer.createTransport({ service:'Gmail', auth: { …
Sri Harsha
  • 641
  • 2
  • 8
  • 18
24
votes
7 answers

Nodemailer send email without smtp transport

I am trying to send emails via nodemailer without SMTP transport. So i've done that: var mail = require("nodemailer").mail; mail({ from: "Fred Foo ✔ ", // sender address to: "******@gmail.com", // list of receivers …
Vinz243
  • 9,654
  • 10
  • 42
  • 86
23
votes
3 answers

Nodemailer and Gmail after May 30 2022

Sending an email using NodeMailer & Gmail Google has reported that after May 30 third party apps cannot use username and password for signing in. Does this affect nodemailer. We usually allow less secure APP in the gsuit gmail setting before using…
Ujjual
  • 958
  • 2
  • 10
  • 36
22
votes
3 answers

How change the sender name of a mail with nodemailer?

I use Nodemailer with a gmail account and I would like to change the sender name. But I don't find how to do. The sender name is actually my email address, but I prefer to have "Consultation". This is my code: var smtpTransport =…
Malaury Boudon
  • 656
  • 1
  • 8
  • 18
22
votes
6 answers

Nodemailer using gmail, Cannot create property 'mailer' on string 'SMTP'

I am trying to send the data from the form I created to my gmail account, when clicking the sumbit button I always get the same error. I found a lot of issues about nodemailer, but none of them seem to be the same issue as I am experiencing.…
Kyle van Til
  • 285
  • 1
  • 3
  • 12
21
votes
5 answers

Sending email from local host with Nodemailer

I'd like to send mails on my local server but it seems not working with Nodemailer and NodeJS. Is there any solutions to send mails from local? var contact = {subject: 'test', message: "test message", email: 'visitor@gmail.com'}; var to =…
tonymx227
  • 5,293
  • 16
  • 48
  • 91
20
votes
3 answers

Nodemailer Error Can't Fix

I have a very simple application, just starting to get my hands dirty with nodemailer. When I run the app I get errors in the module itself. app.js: const nodemailer = require('nodemailer'); const transporter =…
A. Hickman
  • 225
  • 1
  • 2
  • 7
20
votes
6 answers

Nodemailer and Amazon SES

My structure: site -- node_modules ---- nodemailer -- webclient ---- js ------- controller.js site/node_modules/nodemailer site/webclient/js/controller.js site/webclient/js/controller.js: var nodemailer =…
O P
  • 2,327
  • 10
  • 40
  • 73
20
votes
4 answers

Mocking email function in nodejs

I've got a mailer function I've built and trying to shore up the coverage. Trying to test parts of it have proven tricky, specifically this mailer.smtpTransport.sendMail var nodemailer = require('nodemailer') var mailer = {} mailer.smtpTransport…
uxtx
  • 329
  • 1
  • 2
  • 9