Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
  • 02:12
    github-actions[bot] unlabeled #1392
  • May 19 15:25
    bangal18 commented #438
  • May 19 15:11
    bangal18 commented #438
  • May 19 13:06
    cool51 opened #1417
  • May 19 02:26
    jared-leddy commented #1392
  • May 19 02:15
    github-actions[bot] labeled #1392
  • May 19 02:15
    github-actions[bot] commented #1392
  • May 17 06:16
    apeengggg opened #1416
  • May 17 02:13
    github-actions[bot] closed #1400
  • May 17 02:13
    github-actions[bot] commented #1400
  • May 16 09:01
    iftikharkhan90 opened #1415
  • May 15 07:46
    andris9 closed #1414
  • May 15 07:46
    andris9 commented #1414
  • May 15 07:46
    andris9 closed #1406
  • May 15 07:46
    andris9 commented #1406
  • May 15 07:35
    leungkinghin opened #1414
  • May 15 07:34
    leungkinghin commented #1406
  • May 15 07:32
    leungkinghin commented #1406
  • May 13 02:15
    github-actions[bot] closed #1398
  • May 13 02:15
    github-actions[bot] commented #1398
i am getting error { Error: connect ECONNREFUSED at Object.exports._errnoException (util.js:1018:11) at exports._exceptionWithHostPort (util.js:1041:20) at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1086:14) code: 'ECONNECTION', errno: 'ECONNREFUSED',
@akileshv Try connecting to your SMTP server using telnet command.
Ex: telnet 587, send us output
@pranshu792 Unable to connect to remote host: Connection refused
SMTP is not listening on your local and 587 port, make sure it is running and have proper rights to connect to it.
Peter Reid
errrm...anyone got any idea what's going on with the repo?
commits to master have re-initialised the repository.. @andris9
Hey guys, I've got windows 10 with windows defender. I configured my smtp server with smtp-server but I get a "self signed certificate error" when I try to send an email. I disabled my antivirus and I still have this issue. Any ideas how to fix this or does anyone have a snippet that can get me started??
Hi guys, I am on node version 4.3.1, when I add "nodemail":"*" in my package.json and run "npm i" I get this error: npm ERR! notarget No compatible version found: mongoose@~3.1.2
I dont have any other dependency in my package.json
oops, ignore, it should be nodemailer not nodemail
AbdulSamii Ajala
HI everyone!
I have built a WebRTC app for video, audio and file transfer. But the last requirement is that users invite their friends on to the platform to chat with them. So my question is how do I achieve that with nodemailer without using my email as the sender but rather the users' email.
Hi everyone, I'm trying to attach files to my emails being sent with Nodemailer. Emails are going through, but the issue is that I don't receive the attachments, I need to attach a jpg image, tried with that and text too but no success. I'm using Gmail for both sender and receiver. Anyone any clue? It would be much appreciated.

Hi Guys,
i want to use nodemailer with sendmail but got:

{ Error: connect ECONNREFUSED
at Object.exports._errnoException (util.js:1018:11)
at exports._exceptionWithHostPort (util.js:1041:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1090:14)
syscall: 'connect',
address: '',
port: 25,
command: 'CONN' }

telnet works

$ telnet 25
Connected to
Escape character is '^]'.
220 bla@blub.tld ESMTP Postfix (Ubuntu)

iptables is configured to accept allr outgoing

Do you have any advice why i got this connection refused?
Ah okay i think i found my error. It was caused by configuration problems because i used nodemailer inside a docker container.
but thanks anyway

Okay my error still exists but i am able to send a mail from the guest os (docker container) through the host os postfix (MTA).
It seem to my that nodemailer tries to open a connection to the MTA of the guest os (docker container) which has no MTA installed.
My first assumption was that the nodemailer-sendmail-transport is not spawning the proper command and put a log out before to inspect the spawned command and args but this section is never reached.

So, is nodemailer open a connection to during transport creation?
Can i configure this behavior?
Because i only need to spawn the sendmail command to get my sending a email issue working ... ?

Ah i forgot I am using the nodemailer version 2.7.0 and sendmail-transport 1.0.2

Can you guys please help me and provide an advice how to solve the last remaining config issue for my problem?


Okay now i upgraded to version 4.0.1 and use the internal sendmail feature.
This gives me the success callback but the mail is not send.

sendmail command spawned: /usr/sbin/sendmail [ '-i', '-f', 'blah@blub.de', 'test@gmail.com' ]

Result is:
Mail send { envelope:
{ from: 'blah@blub.de',
to: [ 'test@gmail.com' ] },
messageId: '18db223c-6e90-a629-4c2e-e6647a939bc6@blub.de',
response: 'Messages queued for delivery' }

i logged the spawned command then and use it manualy in the terminal and my mail was send.
This is a curious behaviour. (@.@)

Anyone have an idea about this?

AbdulSamii Ajala

I am developing a pure node App (without express or any other framework)
I stored some values in the req (request) object like this

req.token = uuid();

in another route, when I did this


I get undefined. Please is there a sure way of saving value into the http request object for later use?

Hi guys, have you guys is the templateSender function for built in templating gone in nodemailer 4.1.0? Looking in tutorials this was the function needed to do builtin templating
I've set X-Mailer header but it always return "X-Mailer: nodemailer (2.7.2; +https://nodemailer.com/; SMTP/2.7.4[client:2.12.0])"
Can I override X-Mailer header? thanks
Joe Early

Hi all, I am wondering why the following:

from: req.params.name + ' <' + req.params.email + '>',

keeps returning the error: Domain of sender address XXXXXX@gmail.com&#62 does not exist

It does not seem to like the "right-tag" on at the end.
Joe Early
from: req.params.name + ' ' + req.params.email,
This worked fine :shipit:
Joe Early
HI all, quick question if someone can answer. I am trying to send in a contact form, and when its "message" is larger than 260 char, it fails to complete the request.
Running expressjs and I think its an issue there but am asking in here just in case
while sending email How to cache the template file so that it will not compile for each request?
Volodymyr Besyada
Hello, it is possible to send mail to multi users(example to:'o@gmail.com, s@gmail.com...'). But when they receive mail in field receive user seen just his email(not list of all receivers)?
Abdul Jalil Laguindab
@UaSensei do you mean cc and bcc? if it is then nodemailer does support it.
Volodymyr Besyada
@wnxhaja thx!
i don't know this responce { Error: getaddrinfo ENOTFOUND stmp.gmai.com stmp.gmai.com:587
at errnoException (dns.js:53:10)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:95:26)
errno: 'ENOTFOUND',
syscall: 'getaddrinfo',
hostname: 'stmp.gmai.com',
host: 'stmp.gmai.com',
port: 587,
command: 'CONN' }
Jithin James
Is there any example to show how to use nodemailer-build-attachment with nodemailer.
Alexander Escamilla
Please mention me. Apple mail Mac/iphone does not show my pdf attachment. I am using nodemailer and AWS to send out emails. It works well on Chrome though. Here is my attachment config.
            path: path + pdfFileName,
            filename: pdfFileName,
            contentType: 'application/pdf'
Egwuenu Gift
Hello I'm working with nodemailer in my sailsjs application is there a way for me to defie the To: sender email without inputing a string?
Ben Chiciudean
I have an issue when trying to send email using an office365 email address, this is the log:
[2018-06-21 12:32:20] DEBUG Creating transport: nodemailer (4.6.7; +https://nodemailer.com/; SMTP/4.6.7[client:4.6.7])
[2018-06-21 12:32:20] DEBUG Sending mail using SMTP/4.6.7[client:4.6.7]
[2018-06-21 12:32:20] INFO  [lBg35Kf9cPY] Connection established to
[2018-06-21 12:32:20] INFO  [lBg35Kf9cPY] Connection upgraded with STARTTLS
[2018-06-21 12:32:20] DEBUG [lBg35Kf9cPY] SMTP handshake finished
[2018-06-21 12:32:27] INFO  [lBg35Kf9cPY] User "ben@synthbit.io" failed to authenticate
[2018-06-21 12:32:27] DEBUG [lBg35Kf9cPY] Closing connection to the server using "end"
[2018-06-21 12:32:27] ERROR Send Error: Invalid login: 535 5.7.3 Authentication unsuccessful [VI1PR0502CA0027.eurprd05.prod.outlook.com]
my credentials are correct as I can login fine from office365 portal
Ben Chiciudean
it was Multi-factor authentication, I disabled it for my account
is there way to create app password for nodemailer?
Ben Chiciudean
is it possible to store/save sent emails?
I’m using the Outlook365 service
I tried sending emails in bulk using Smtp Gsuite, but I got the problem "trying an attempt login"
how to fix it?

Can't find solution to this error

{ Error: connect ECONNREFUSED
    at Object.exports._errnoException (util.js:1050:11)
    at exports._exceptionWithHostPort (util.js:1073:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1093:14)
  code: 'ECONNECTION',
  errno: 'ECONNREFUSED',
  syscall: 'connect',
  address: '',
  port: 465,
  command: 'CONN' }

I also tried using 587 but same error, there no process using the ports

    var transporter = nodemailer.createTransport({
        service: 'smtp.gmail.com',
        port: 465,
        auth: {
          user: process.env.EMAIL,
          pass: process.env.PWD
Álvaro Arcaya
@justinemar use h ost instead of service
host *