Questions tagged [nodemailer]
Easy to use module to send e-mails with Node.JS
nodemailer
2,497
questions
162
votes
30
answers
304k
views
Nodemailer with Gmail and NodeJS
I try to use nodemailer to implement a contact form using NodeJS but it works only on local it doesn't work on a remote server...
My error message :
[website.fr-11 (out) 2013-11-09T15:40:26] { [...
98
votes
10
answers
114k
views
Username and Password not accepted when using nodemailer?
This is my settingController:
var sendSmtpMail = function (req,res) {
var transport = nodemailer.createTransport({
service:'gmail',
auth: {
user: "asdfqweerrccb@limitlesscircle....
73
votes
8
answers
254k
views
POST request not allowed - 405 Not Allowed - nginx, even with headers included
I have a problem in trying to do a POST request in my application and I searched a lot, but I did not find the solution.
So, I have a nodeJS application and a website, and I am trying to do a POST ...
58
votes
9
answers
112k
views
Sending email to multiple recipients via nodemailer
I am trying to send email to multiple recipients. For this I have created an array of recipients, but with my code I am only able to send mail to last email ID of the array three times. What's wrong ...
58
votes
12
answers
125k
views
Pass variable to html template in nodemailer
I want to send email with nodemailer using html template. In that template I need to inject some dynamically some variables and I really can't do that. My code:
var nodemailer = require('nodemailer');...
57
votes
15
answers
105k
views
Missing credentials for "PLAIN" nodemailer
I'm trying to use nodemailer in my contact form to receive feedback and send them directly to an email. This is the form below.
<form method="post" action="/contact">
<label for="name"&...
50
votes
11
answers
153k
views
Sending email via Node.js using nodemailer is not working
I've set up a basic NodeJS server (using the nodemailer module) locally (http://localhost:8080) just so that I can test whether the server can actually send out emails.
If I understand the SMTP ...
50
votes
4
answers
47k
views
how to show all console.log from node.js in heroku?
I have deployed a node.js application to node.js but not able to see the complete console.log statements from my app. I am using:
heroku logs
Some of the logging is shown but looks like it is not ...
47
votes
3
answers
31k
views
Nodemailer/Gmail - What exactly is a refresh token and how do I get one?
I'm trying to do a simple contact form in a node app, using nodemailer. I want all the msg to be sent from a gmail account I made for this purpose, to my personnal mail.
on the client side, all I do ...
43
votes
9
answers
95k
views
How to attach file to an email with nodemailer
I have code that send email with nodemailer in nodejs but I want to attach file to an email but I can't find way to do that I search on net but I could't find something useful.Is there any way that I ...
34
votes
4
answers
54k
views
Node.js and Nodemailer: Can we attached PDF documents to emails?
I am wanting to attach a PDF document using nodemailer and node.js, however, the only examples I am finding for attachments with nodemailer is with .txt files (here).
Does anyone know if PDF ...
33
votes
7
answers
30k
views
Nodemailer throws error Invalid login: 534-5.7.14
I found this error while i'm trying to send an email from one Gmail account to another. How to solve this error ? Help me on it.
There were an error:
Invalid login: 534-5.7.14
Please
log in ...
33
votes
4
answers
57k
views
Embed image in email body nodemailer nodejs
I am following the approach used in the nodemailer community site
but I cannot seem to get it to work as I am getting the error
Failed to send email { Error: ENOENT: no such file or directory, ...
31
votes
3
answers
28k
views
How to change the "from" field in nodemailer?
Disclaimer: I'm not very good with technical email aspects.
So I've setup up a free zoho mail account which basically is just an mail server for my domain. This kinda works via mx record forwarding ...
28
votes
7
answers
43k
views
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 ...
27
votes
7
answers
34k
views
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 ...
26
votes
8
answers
38k
views
node.js email doesn't get sent with gmail smtp
I'm trying to send the email gmail smtp but I'm getting the error:
My email and password is correct I'm using the nodemailer for sending the mail;
var nodemailer = require('nodemailer');
...
26
votes
8
answers
58k
views
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
...
25
votes
3
answers
19k
views
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 ...
25
votes
3
answers
24k
views
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'...
25
votes
2
answers
11k
views
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 Documentation
https://nodemailer.com/smtp/oauth2
https://nodemailer....
25
votes
1
answer
56k
views
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 = {
...
24
votes
8
answers
41k
views
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....
24
votes
7
answers
56k
views
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 ✔ <[email protected]>", // sender ...
24
votes
3
answers
15k
views
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 ...
22
votes
6
answers
29k
views
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 ...
21
votes
7
answers
36k
views
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 ...
21
votes
5
answers
38k
views
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 ...
20
votes
3
answers
12k
views
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 ...
20
votes
4
answers
12k
views
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('...
19
votes
2
answers
38k
views
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.<anonymous> (_tls_wrap.js:1092:38)
...
19
votes
2
answers
11k
views
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 ...
19
votes
5
answers
12k
views
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 ...
18
votes
2
answers
24k
views
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 ...
18
votes
2
answers
22k
views
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.
...
17
votes
2
answers
36k
views
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 ...
17
votes
8
answers
18k
views
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, ...
17
votes
1
answer
5k
views
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....
17
votes
2
answers
17k
views
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 ...
15
votes
1
answer
19k
views
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 ...
15
votes
8
answers
38k
views
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 = ...
15
votes
1
answer
14k
views
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 ...
14
votes
6
answers
24k
views
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 ...
14
votes
2
answers
10k
views
verify if email is delivered successfully nodemailer (sails.js)
I'm using nodemailer module to send email in my sails.js project. Now i'm wondering if there is a way that i could know if the email is delivered successfully or the email is somehow failed due to ...
14
votes
5
answers
11k
views
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(...
13
votes
1
answer
9k
views
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: ...
13
votes
2
answers
23k
views
node.js nodemailer gmail error
Im trying to send a email using node.js - nodemailer module , my whole code looks like
var http=require("http");
var nodemailer=require("nodemailer");
http.createServer(function(req,res){
res....
13
votes
3
answers
27k
views
External HTML file with CSS as email content in nodemailer
Does anyone know how to tell Node.js´ module nodemailer to use an external HTML file (with links to stylesheets) as email content?
I am able to type in HTML tags as email content but I prefer loading ...
13
votes
1
answer
21k
views
Error: Hostname/IP doesn't match certificate's altnames node.js
i want tom send email from my application using nodemailer , my code looks like this :
var smtpTransport = nodemailer.createTransport(smtpTransport({
pool: true,
host: 'smtp....
13
votes
2
answers
3k
views
Post Angular form data to Node.js with Sendgrid/Nodemailer
I have followed this example to post data from my Angular app to Node.js to post a webform to Sendgrid. This works fine after some changes and thanks a lot for the quickstart. Posting my form data to ...