Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
  • Nov 26 01:39
    roubert commented #1128
  • Nov 25 22:25
    kapekost commented #1128
  • Nov 25 22:14
    roubert commented #1128
  • Nov 25 20:40
    kapekost commented #1128
  • Nov 25 07:16
    Muhzn closed #1215
  • Nov 25 06:38
    Muhzn edited #1215
  • Nov 25 06:37
    Muhzn edited #1215
  • Nov 25 06:37
    Muhzn edited #1215
  • Nov 25 06:37
    Muhzn opened #1215
  • Nov 24 12:16
    webspecialist edited #1214
  • Nov 24 12:16
    webspecialist opened #1214
  • Nov 20 22:19
    acalvino4 commented #1170
  • Nov 20 13:34
    cagross commented #1212
  • Nov 19 18:21
    DYW972 commented #1160
  • Nov 18 21:16
    Travis nodemailer/wildduck (master) passed (1060)
  • Nov 18 20:26
  • Nov 18 20:02
    Travis nodemailer/wildduck (v1.31.3) passed (1058)
  • Nov 18 19:23
    Travis nodemailer/wildduck (v1.31.2) passed (1056)
  • Nov 18 18:26
    Travis nodemailer/wildduck (v1.31.1) passed (1054)
  • Nov 18 17:24
    Travis nodemailer/wildduck (v1.31.0) passed (1052)
    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 *
Make It Count
Need recommendations to approach email templates
I am using nodemailer v2.x and node v4.6.1. Trying out EmailTemplate v2.x
Want to make it modular structure with css inline and other heavy lifting should be done by libraries such as emailtemplate. Don't know much of the options I might have
Make It Count
why so silence
@boldt ca n you help
Chris Davis
Good day everyone, I have an interesting problem i was hoping you could help me with. I just deployed my nodejs/express site live out into the wild onto a digital ocean droplet with a domain name pointing to it and everything! 🤘 Everything was going great until i noticed spam bots submitting bogus data to my contact form which i'm using nodemailer to send. I set up a hidden honeypot field that cancels form submission if not empty, i thought that would do it, but no luck. I searched the internet, npm for packages and stackoverflow high and low for a solution and came up with nothing. If anyone has any suggestions, i would be all ears! Thank you in advance for your help 😊
Chris Davis
Just in case anyone was curious. I was able to get it done with the NPM package email-existence. Thanks all for the help.
Existence is determined by telnetting to the MX server of the email domain and attempting to send an email to the supplied address. MX servers return 250 if the email address exists and 550 if it does not.
app.post("/products/contactCorporate", function (req, res) {
  let { name, email, message, businessAddress } = req.body;

  emailExistence.check(email, function (error, response) {
    if (response === false) {
      req.flash('success', 'Sorry, the email seems to be spam!');
    } else {
Is @types/nodemailer up to date?
Mathieu Ghennassia
Hello, I'd like to run a smtp server in my tests to catch outgoing emails. I'm testing smtp-server + nodemailer.
const { SMTPServer } = require('smtp-server');
const nodemailer = require('nodemailer');

const SMTPServerInstance = new SMTPServer({
  logger: true,
  debug: true,
  authOptional: true

SMTPServerInstance.listen(() => {
  console.log('SMTP server is listening!\n');

  const transporter = nodemailer.createTransport({
    logger: true,
    debug: true,
    host: SMTPServerInstance.server.address().address,
    port: SMTPServerInstance.server.address().port,
    ignoreTLS: true

  console.log('Sending email...');
      from: 'sender@example.com',
      to: 'receiver@example.com',
      subject: 'Subject',
      text: 'Text',
      html: 'HTML'
    .then((info) => {
      console.log('Email successfully sent!', info);
    .catch((err) => {
      console.log('Error when sending an email:', err);
    .finally(() => {
I'm not sure why I set ignoreTLS: true on the client. I'd like to disable any auth/encryption on the server, the client should adapt by itself.
And I'm not convinced with authOptional: true on the server, I want it disabled not optional.
Mathieu Ghennassia
Mathieu Ghennassia
Second thing, I don't understand why attributes host+port doesn't work like attribute url. I'm trying to do url: 'smtp://{host}:{port}' but I get a TLS upgrade: https://runkit.com/mathieug/nodemailer--smtp-server/1.0.1
Surbhi Rawat
i have used nodemailer for my app and every time my emails are going in spam...can anyone suggest the solution for this?
i'm using bluehost and while sending mails directly through my account its working fine but using node server mails are going in spam
do you guys model your data for the view into the mailer service or outside?
like for ex
when sending an email for a new order being created
Hi, how can I check if the connection is still working?
@mathieug Did you end up getting that to work?
Eugen Cazacu
hi there, i am helping a friend to automate his workflow and gmail is unreliable. do you have any good free email provider we can try out? thanks
@oygen87 What kind of automation?
For receiving/parsing there's testmail.app
hi everybody, can we send and email without smtp ?
Michael Khoroshun
hi, can anyone help me to figure out what the problem is?
I have the following config:
"mailer": { "host": "email-smtp.eu-central-1.amazonaws.com", "port": 2587, "secure": true, "auth": { "user": "user", "pass": "pass" }
And code:
let transporter = nodemailer.createTransport(app.get('mailer')); app.use('/mailer', mailer(transporter));
It ends up with:
Error: connect ECONNREFUSED
But in the same time from terminal
telnet email-smtp.eu-central-1.amazonaws.com 2587
Trying Connected to email-smtp.eu-central-1.amazonaws.com. Escape character is '^]'. 220 email-smtp.amazonaws.com ESMTP SimpleEmailService-d-W0F3CN0 OMZCUaPbOVT1Ookc
What can be the problem here?
Try to add rejectUnauthorized: false
Daniel Marcano
Could anyone help me with nodemailer and sending emails through SMTP?
For now it only works if I use tls: { rejectUnauthorized: false }
But I take it this would allow MITM attacks for my site... and that's not the point, of course.
The thing is that I do not understand what is it that I need to add as a Certificate Authority, nor how.
And have not found any clear/straightforward information on this on the web...
Lean Junio
Hey guys, has anyone gotten success with sending using sendmail?
Paulo Azevedo
Hello guys. Is there a way to send a PLAIN TEXT email with Node Mailer?
Hi, I need help to make my project work.
hello guy! I an error during installing nodemailer using npm
@gacto I get an error*
Dennis Prochniak
Error: connect ECONNREFUSED
const transport = nodemailer.createTransport({direct: true})
trying to send to gmail...
is there an option to directly connect to rcpt smpt?
Dennis Prochniak
I want to replicate $ swaks --to myemail@gmail.com -- from myemail@gmail.com
nodemailer with direct transport should attempt contacting gmails smtp
not localhost

hello guys, how to add a certificate?? i am using this its works on local but not live server

let transporter = nodemailer.createTransport({ host: "ro*****.com", port: 465, secure: true, auth: { user: "devel********p.com", pass: "4*******$" }, tls: { rejectUnauthorized: false } });

Hi guys, I am trying to embed pdf in email body. Is there a way to do it?(Note: Not as an attachment)
Joey Merino
react - express- nodemailer w 0auth2 crash post req on deployment but fine in local
Damian Toczek
Hi guys, I've tried almost everything and I simply can't run nodemailer. I always get this error: TypeError: Cannot create property 'mailer' on string 'SMTP'
Andris Reinman
@damiantoczek please follow Nodemailer documentation for setting up the transport object. From that error message it seems like you are using older Nodemailer configuration that was deprecated already in 2014. This configuration has not worked for the past 6 years. https://nodemailer.com/about/#example