Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7843337
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T16:31:34+00:00 2026-06-02T16:31:34+00:00

I am trying to use gmail smtp using node_mailer . I get following error

  • 0

I am trying to use gmail smtp using node_mailer. I get following error on my nodejs logs (using nodester). Here is my code:

var email = require('mailer');
email.send({
    host : "smtp.gmail.com",              
    port : "465",                     
    ssl : true,
    domain : "domain.com",            
    to : "emailId@gmail.com",
    from : "email@gmail.com",
    subject : "You have been registered",
    body: "<B>Hello! This is a test of the node_mailer.</B>",
    authentication : "login",        // auth login is supported; anything else is no auth
    username : /* username */,
    password : /* password */      
    },
    function(err, result){
      if(err){ self.now.error(err); console.log(err); return;}
      else this.now.successfullySent(result);
});

I am not getting any error in the stack but email is not getting delivered.

@work4liberty and @David Ellis. Thanks for both of yours inputs but it seems that the problem was not with my server code, I was sending incorrect value in emailId from my client-side javascript. Nodemailer did help me debug the issue with correct text in error.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T16:31:35+00:00Added an answer on June 2, 2026 at 4:31 pm

    A couple things:

    1. Your code as written will throw an interpreter error and not run. (No quotes around an email address, for instance.)
    2. That library hasn’t been updated in a while. I highly recommend the actively-developed and similarly-named Nodemailer library that has shorthand for common services such as gmail’s SMTP.

    Full Disclosure: I contributed the Amazon SES functionality to Nodemailer (though a recent rewrite of the underlying architecture from 0.1.x to 0.3.x means I don’t show up on git blame, anymore).

    EDIT: I took a closer look at your code. Assuming you don’t have the typos in your actual code, I suspect the following line is the culprit: this.now.successfullySent(result);

    Basically, the callback function’s this is not what you think it is. You’ll want to cache the this object in its scope by assigning it to a variable like self. (Assuming we’re not dealing with a problem in the underlying library.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to use gmail's SMTP server smtp.gmail.com to send mails using C
I am trying to send email through gmail using PHPMailer_V5.1. Getting the following error,
I am currently trying to use JavaMail to get emails from IMAP servers (Gmail
I am trying to send an email via GMail from ASP.Net using the code
I've been trying to use openssl to establish a connection with smtp.gmail.com port 587
I am trying to use PEAR Mail to send from my gmail address using
I've been trying to use 'import poplib' to access gmail, since I have Pop
I'm trying use mod_rewrite to rewrite URLs from the following: http://www.site.com/one-two-file.php to http://www.site.com/one/two/file.php The
I'm trying to send e-mails from my localhost, using my gmail account, I've looked
I am using the following program for sending email through Java. When I use

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.