I'm using Nodemailer (Node js) to send Email via Gmail but i'm getting errorSending emails in Node.js?Nodemailer with Gmail and NodeJSNodeMailer : getaddrinfo Errorsend email via nodemailerNodemailer Gmail timeoutECONNREFUSED on NodeUsing nodemailer and smtp send mail without authenticationUnable to send email through node js, tried few methodsNodemailer - SMTP Timeout - office365sendgrid set up with @sendgrid/mail

Importance of electrolytic capacitor size

How does Harry wear the invisibility cloak?

Do index funds really have double-digit percents annual return rates?

What happens if I double Meddling Mage's 'enter the battlefield' trigger?

Time to call the bluff

Adding transparency to ink drawing

Why would a Intel 8080 chip be destroyed if +12 V is connected before -5 V?

Too many SOQL Queries when inserting records

Does POSIX guarantee the paths to any standard utilities?

Do mortgage points get applied directly to the principal?

One hour 10 min layover in Newark; International -> Domestic connection. Enough time to clear customs?

Go for an isolated pawn

How could it be that the capo isn't changing the pitch?

Generate points for smooth movement between two given points

Splitting polygons at narrowest part using R?

Was "The Hobbit" ever abridged?

Punishment in pacifist society

Why didn't Thatcher give Hong Kong to Taiwan?

How to encode a class with 24,000 categories?

Is there any difference between these two sentences? (Adverbs)

What is the most likely cause of short, quick, and useless reviews?

How many days for hunting?

How do I make my fill-in-the-blank exercise more obvious?

MOSFET broke after attaching capacitor bank



I'm using Nodemailer (Node js) to send Email via Gmail but i'm getting error


Sending emails in Node.js?Nodemailer with Gmail and NodeJSNodeMailer : getaddrinfo Errorsend email via nodemailerNodemailer Gmail timeoutECONNREFUSED on NodeUsing nodemailer and smtp send mail without authenticationUnable to send email through node js, tried few methodsNodemailer - SMTP Timeout - office365sendgrid set up with @sendgrid/mail






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I want to send email via Gmail or other email provider like office 365 using Nodemailer as my module Node.js.



I wanna ask also if there's a proxy or firewall setting to disable so that I can send email using gmail or office 365.



Or maybe there is something wrong with my code ?



const nodemailer = require("nodemailer");



const smtpTransport = require('nodemailer-smtp-transport');



function sendEmail(to, subject, html)



nodemailer.createTestAccount((err, account) => 
let transporter = nodemailer.createTransport(
host: 'smtp.gmail.com',
port: 465,
secure: true,
auth:
user: 'philip@gmail.com',
pass: 'sercretpass'

);


let mailOptions =
from: '"Admin" ',
to: to,
subject: subject,
html: html
;



 transporter.sendMail(mailOptions, (error, info) => 
if (error)
console.log('Error', error);

else
console.log('Success', info);

);
);




module.exports.sendEmail = sendEmail;



MY ERROR :



Error Error: connect ETIMEDOUT 74.125.203.108:465
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1121:14)
errno: 'ETIMEDOUT',
code: 'ECONNECTION',
syscall: 'connect',
address: '74.125.203.108',
port: 465,
command: 'CONN'










share|improve this question
































    0















    I want to send email via Gmail or other email provider like office 365 using Nodemailer as my module Node.js.



    I wanna ask also if there's a proxy or firewall setting to disable so that I can send email using gmail or office 365.



    Or maybe there is something wrong with my code ?



    const nodemailer = require("nodemailer");



    const smtpTransport = require('nodemailer-smtp-transport');



    function sendEmail(to, subject, html)



    nodemailer.createTestAccount((err, account) => 
    let transporter = nodemailer.createTransport(
    host: 'smtp.gmail.com',
    port: 465,
    secure: true,
    auth:
    user: 'philip@gmail.com',
    pass: 'sercretpass'

    );


    let mailOptions =
    from: '"Admin" ',
    to: to,
    subject: subject,
    html: html
    ;



     transporter.sendMail(mailOptions, (error, info) => 
    if (error)
    console.log('Error', error);

    else
    console.log('Success', info);

    );
    );




    module.exports.sendEmail = sendEmail;



    MY ERROR :



    Error Error: connect ETIMEDOUT 74.125.203.108:465
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1121:14)
    errno: 'ETIMEDOUT',
    code: 'ECONNECTION',
    syscall: 'connect',
    address: '74.125.203.108',
    port: 465,
    command: 'CONN'










    share|improve this question




























      0












      0








      0








      I want to send email via Gmail or other email provider like office 365 using Nodemailer as my module Node.js.



      I wanna ask also if there's a proxy or firewall setting to disable so that I can send email using gmail or office 365.



      Or maybe there is something wrong with my code ?



      const nodemailer = require("nodemailer");



      const smtpTransport = require('nodemailer-smtp-transport');



      function sendEmail(to, subject, html)



      nodemailer.createTestAccount((err, account) => 
      let transporter = nodemailer.createTransport(
      host: 'smtp.gmail.com',
      port: 465,
      secure: true,
      auth:
      user: 'philip@gmail.com',
      pass: 'sercretpass'

      );


      let mailOptions =
      from: '"Admin" ',
      to: to,
      subject: subject,
      html: html
      ;



       transporter.sendMail(mailOptions, (error, info) => 
      if (error)
      console.log('Error', error);

      else
      console.log('Success', info);

      );
      );




      module.exports.sendEmail = sendEmail;



      MY ERROR :



      Error Error: connect ETIMEDOUT 74.125.203.108:465
      at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1121:14)
      errno: 'ETIMEDOUT',
      code: 'ECONNECTION',
      syscall: 'connect',
      address: '74.125.203.108',
      port: 465,
      command: 'CONN'










      share|improve this question
















      I want to send email via Gmail or other email provider like office 365 using Nodemailer as my module Node.js.



      I wanna ask also if there's a proxy or firewall setting to disable so that I can send email using gmail or office 365.



      Or maybe there is something wrong with my code ?



      const nodemailer = require("nodemailer");



      const smtpTransport = require('nodemailer-smtp-transport');



      function sendEmail(to, subject, html)



      nodemailer.createTestAccount((err, account) => 
      let transporter = nodemailer.createTransport(
      host: 'smtp.gmail.com',
      port: 465,
      secure: true,
      auth:
      user: 'philip@gmail.com',
      pass: 'sercretpass'

      );


      let mailOptions =
      from: '"Admin" ',
      to: to,
      subject: subject,
      html: html
      ;



       transporter.sendMail(mailOptions, (error, info) => 
      if (error)
      console.log('Error', error);

      else
      console.log('Success', info);

      );
      );




      module.exports.sendEmail = sendEmail;



      MY ERROR :



      Error Error: connect ETIMEDOUT 74.125.203.108:465
      at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1121:14)
      errno: 'ETIMEDOUT',
      code: 'ECONNECTION',
      syscall: 'connect',
      address: '74.125.203.108',
      port: 465,
      command: 'CONN'







      node.js node-modules






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 28 at 3:40







      Lep

















      asked Mar 28 at 3:19









      LepLep

      84 bronze badges




      84 bronze badges

























          1 Answer
          1






          active

          oldest

          votes


















          0
















          Are you able to telnet to smtp.gmail.com from the machine on port 465 ?
          Also try with Port 587, with 587, you should see some other error as it works on STARTTLS.






          share|improve this answer

























          • The same error I got but port is 587 and ip is different,.

            – Lep
            Mar 28 at 4:38











          • I also successfully ping the ip address I got from the host. I'm getting loss now I don't know if I need to check proxy or firewall setting.

            – Lep
            Mar 28 at 4:46










          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55389662%2fim-using-nodemailer-node-js-to-send-email-via-gmail-but-im-getting-error%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0
















          Are you able to telnet to smtp.gmail.com from the machine on port 465 ?
          Also try with Port 587, with 587, you should see some other error as it works on STARTTLS.






          share|improve this answer

























          • The same error I got but port is 587 and ip is different,.

            – Lep
            Mar 28 at 4:38











          • I also successfully ping the ip address I got from the host. I'm getting loss now I don't know if I need to check proxy or firewall setting.

            – Lep
            Mar 28 at 4:46















          0
















          Are you able to telnet to smtp.gmail.com from the machine on port 465 ?
          Also try with Port 587, with 587, you should see some other error as it works on STARTTLS.






          share|improve this answer

























          • The same error I got but port is 587 and ip is different,.

            – Lep
            Mar 28 at 4:38











          • I also successfully ping the ip address I got from the host. I'm getting loss now I don't know if I need to check proxy or firewall setting.

            – Lep
            Mar 28 at 4:46













          0














          0










          0









          Are you able to telnet to smtp.gmail.com from the machine on port 465 ?
          Also try with Port 587, with 587, you should see some other error as it works on STARTTLS.






          share|improve this answer













          Are you able to telnet to smtp.gmail.com from the machine on port 465 ?
          Also try with Port 587, with 587, you should see some other error as it works on STARTTLS.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 28 at 4:12









          James DeanJames Dean

          1,4521 gold badge2 silver badges7 bronze badges




          1,4521 gold badge2 silver badges7 bronze badges















          • The same error I got but port is 587 and ip is different,.

            – Lep
            Mar 28 at 4:38











          • I also successfully ping the ip address I got from the host. I'm getting loss now I don't know if I need to check proxy or firewall setting.

            – Lep
            Mar 28 at 4:46

















          • The same error I got but port is 587 and ip is different,.

            – Lep
            Mar 28 at 4:38











          • I also successfully ping the ip address I got from the host. I'm getting loss now I don't know if I need to check proxy or firewall setting.

            – Lep
            Mar 28 at 4:46
















          The same error I got but port is 587 and ip is different,.

          – Lep
          Mar 28 at 4:38





          The same error I got but port is 587 and ip is different,.

          – Lep
          Mar 28 at 4:38













          I also successfully ping the ip address I got from the host. I'm getting loss now I don't know if I need to check proxy or firewall setting.

          – Lep
          Mar 28 at 4:46





          I also successfully ping the ip address I got from the host. I'm getting loss now I don't know if I need to check proxy or firewall setting.

          – Lep
          Mar 28 at 4:46








          Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







          Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55389662%2fim-using-nodemailer-node-js-to-send-email-via-gmail-but-im-getting-error%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

          Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript