3

I was trying to send a simple mail from a Node.js code to my company e-mail which is on outlook but does not have the address as 'mymial@outlook.com' but it is like 'mymail@myorg.co.in'.

I am getting this error:

Error: connect ETIMEDOUT 40.97.170.162:587

Here is the code snippet I use:

var nodemailer = require('nodemailer');
var transporter = nodemailer.createTransport({
    host: "smtp-mail.outlook.com", // hostname
    secureConnection: false, // TLS requires secureConnection to be false
    port: 587, // port for secure SMTP
    tls: {
       ciphers:'SSLv3'
    },
    auth: {
        user: 'myname@myorg.co.in',
        pass: 'password'
    }
});

var mailOptions = {
  from: 'myname@myorg.co.in',
  to: 'myname@myorg.co.in',
  subject: 'Sending Email using Node.js',
  text: 'That was easy!'
};

transporter.sendMail(mailOptions, function(error, info){
  if (error) {
    console.log(error);
  } else {
    console.log('Email sent: ' + info.response);
  }
});

Looking forward for some insights as I am new to this.

Thanks!

Alex M
  • 2,756
  • 7
  • 29
  • 35
Saurav Rath
  • 91
  • 1
  • 3
  • 11

1 Answers1

0

Check for your proxy and confirm if it is smtp or smtpe and then proceed with your username and your mailbox password.

Saurav Rath
  • 91
  • 1
  • 3
  • 11