Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
  • Feb 03 13:58
    dcruz1990 commented #1422
  • Feb 03 11:40
    Codehouze commented #1422
  • Feb 02 02:02
    github-actions[bot] labeled #1497
  • Feb 02 02:02
    github-actions[bot] commented #1497
  • Jan 31 12:35
    andris9 closed #1494
  • Jan 31 12:35
    andris9 commented #1494
  • Jan 31 11:52
    collinskandie commented #1494
  • Jan 31 11:50
    collinskandie commented #1506
  • Jan 30 17:21
    MewadaAnkit closed #1506
  • Jan 30 16:42
    MewadaAnkit opened #1506
  • Jan 28 02:01
    github-actions[bot] unlabeled #1430
  • Jan 28 02:01
    github-actions[bot] labeled #1494
  • Jan 28 02:01
    github-actions[bot] commented #1494
  • Jan 27 13:29
    glr0221 commented #1505
  • Jan 27 12:25
    Sparticuz commented #1430
  • Jan 27 09:44
    andris9 closed #1505
  • Jan 27 09:44
    andris9 commented #1505
  • Jan 27 09:43

    andris9 on v5.2.1


  • Jan 27 09:43

    andris9 on master

    v5.2.1 (compare)

  • Jan 27 09:42

    andris9 on master

    v6.9.1 (compare)

Hi, I need help to make my project work.
Gabriel Zayumba
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
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
Hi guys, On localhost mailer service is working fine but when i deployed on server it's giving me error like
Hostname/IP does not match certificate's altnames: Host: smtp.gmail.com. is not in the cert's altnames
Andris Reinman
you probably have a MITM somewhere, either your company firewall or a virus scanner. Gmail MTA most definitely has a valid cert.

Hey guys. I'm looking to send a string as text as it stores a link to a csv file.

Unsure how to do this correctly

Can anyone recommend the best way to do this?
Hi Team
I am facing issue for the below code:

import as fs from 'fs';
as _ from 'lodash';
import {browser} from "protractor";

let retry = require('retry'),
googleAuth = require('google-auth-library'),
google = require('googleapis'),
gmail = google.gmail('v1');

export class GmailHelper {
// Getting an auth object
static getAuth() {
let auth = new googleAuth(),
oauth2Client = new auth.OAuth2(
oauth2Client.credentials = {"client_id": "159ab9cfa0b5f30e",};
return oauth2Client;

// Converts the query passed as an object into a string
private static convertQuery(query: any): string {
    return _.map(query, (operator, item) => `${item}:${operator}`).join(' ');

// Retrieve a list of emails, matching the specified query,  from the authenticated inbox. The query is an object like: {from: ''}
async searchForEmails(query: any): Promise<Array<any>> {
    const res_1 = await this.googleCallWrapper((cb: any) => {
            auth: GmailHelper.getAuth(),
            userId: 'me',
            q: GmailHelper.convertQuery(query)
        }, cb);
    }, (err: any, res: { messages: any; }) => {
        return err ? err : res.messages == undefined;
    return res_1.messages;

// Retrieve the full data of a specific email from the authenticated inbox
async getEmailContent(id: any): Promise<any> {
    const res_1 = await this.googleCallWrapper((cb: any) => {
            auth: GmailHelper.getAuth(),
            userId: 'me',
            id: id
        }, cb);
    }, (err: any, res: any) => {
        return err;
    return res_1;

// Wraps all types of gmail calls into promise notation and retries the call x number of times with a scaling up timeout
// Also performs `browser.waitForAngular()` before the call in order to allow the operation on the page to finish before 
// checking for the email
* @param googleCall {Function(googleCallback: Function) : Void} a function which performs a GoogleAPI call. When called, it is passed a GoogleAPI callback function which needs to be passed to the GoogleAPI
* @param shouldRetry {Function(error: string, response: Object) : boolean} a function which decides whether we should retry the GoogleAPI call. When called, it is passed the same arguments as the GoogleAPI callback function. It should return true if an error occurred or if the response is not satisfactory
googleCallWrapper(googleCall: Function, shouldRetry: Function): Promise<any> {
    return new Promise(async (resolve, reject) => {
        let operation = retry.operation({
            retries: 4,
            minTimeout: 1000,
            maxTimeout: 3000,
            factor: 1.5,
        try {
            await browser.waitForAngular();
            return operation.attempt(function (currentAttempt: any) {
                googleCall((err: any, res: any) => {
                    if (operation.retry(shouldRetry(err, res))) {
                        console.log('Retrying the email check');
                    if (err) {
                        console.log('Email not found!');
                    } else {
                        console.log('Email found!');
        } catch (err_1) {


Issue part is:
static getAuth() {
    let auth = new googleAuth(),
        oauth2Client = new auth.OAuth2(
    oauth2Client.credentials = {"client_id": "159ab9cfa0b5f30e",};
    return oauth2Client;
please help!
Daniel Mulvad
Howdy guys, I'm sure this has been asked before, but I can't seem to find the answer online. I cannot send emails when running nodemailer in a alpine-node docker container.
here is my config:
    const mail = nodemailer.createTransport({
      host: 'smtp.office365.com',
      port: 587,
      secure: false,
      auth: {
        user: process.env.SMTP_USERNAME,
        pass: process.env.SMTP_PASSWORD
this is my error:
mail error:  Connection timeout {"code":"ETIMEDOUT","command":"CONN","stack":"Error: Connection timeout\n    at SMTPConnection._formatError (/app/node_modules/nodemailer/lib/smtp-connection/index.js:774:19)\n    at SMTPConnection._onError (/app/node_modules/nodemailer/lib/smtp-connection/index.js:760:20)\n    at Timeout.<anonymous> (/app/node_modules/nodemailer/lib/smtp-connection/index.js:229:22)\n    at listOnTimeout (node:internal/timers:556:17)\n    at processTimers (node:internal/timers:499:7)","timestamp":"2021-02-01 19:19:49"}
Daniel Mulvad
I've read the documentation that says: Check your firewall settings. Timeout usually occurs when you try to open a connection to a port that is firewalled either on the server or on your machine. but the ports are open in docker
Hello, Everyone.
I got some error when I try to send email by gmail.
ERROR Error: connect ETIMEDOUT
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16) {
errno: -4039,
code: 'ESOCKET',
syscall: 'connect',
address: '',
port: 587,
command: 'CONN'
1 reply
This is error message.
Please help me to solve this problem.
Subhrajyoti Pradhan

I am getting this error while trying to send email via nodemailer.

"code": "EDNS",
"errno": "ENOTFOUND",
"syscall": "getaddrinfo",
"hostname": "aaa.bbb.aro.com.br",
"command": "CONN"

Can anybody help me to resolve this ?
I think your problem is that DNS is not resolving to that host, try dig aaa.bbb.aro.com.br to check that
Hello, I'm having an issue with gmail and nodemailer, I'm connecting using imap.gmail.com and Application Passwords, the script connect successfully, it passes de verifyOnly check but when i do fetch({ address: "some@address.com" }) it fails with Command failed error, no more output than that :(, can anyone help me?
I'm using imapflow, not nodemailer, sorry
Sergio Mendoza Matos
Terry Hunt

Hello, I'm having issues with attachments:

router.post("/complaint", (req, res) => {
const cName = req.body.cName;
const cAddress = req.body.cAddress;
const phone = req.body.phone;
const email = req.body.email;
const vName = req.body.vName;
const vAddress = req.body.vAddress;
const violation = req.body.violation;

const mail = {
from: "example@example.com",
to: "example@example.com",
subject: Complaint from ${cName} on ${vName},
html: The message is from ${cName} <br /> Complaint's Name: ${cName} <br /> Complaint's address: ${cAddress} <br /> Email: ${email} <br /> Phone: ${phone} <br /> Violator's Name: ${vName} <br /> Violator's Address: ${vAddress} <br /> Violation: ${violation} <br /> Attachment Image(s):<img src="cid:imageFiles" />,
attachments: [
filename: "image.png",
path: "/files/images/",
cid: "imageFiles",

No error codes displayed
I am getting this error when trying to send email using SMTP nodemailer.
Error: connect ETIMEDOUT smtpHost:587
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1128:14) {
errno: 'ETIMEDOUT',
code: 'ESOCKET',
syscall: 'connect',
address: 'smtpHost',
port: 587,
command: 'CONN'
Anyone found solution for this?
Aditya Todkar
I want to send emails using nodemailer can I send links with plain text emails?
@danielmulvad I'm guessing this might be a general issue because i tried with Rackspace webmail smtp and run my script like node app.js. it even take time to execute , like 1-3mins stacked before i get the error.
I am getting connect ETIMEDOUT error while sending mail using nodemailer.. can anyone let me know how do I resolve??