1

Im using Nodemailer module to send smtp emails from my hotmail/outlook account. I have hosted my app at amazon ec2. My code to send the email:

var smtpTransport = nodemailer.createTransport("SMTP",{
    service: 'Hotmail',
    auth: {
        user: 'xxxxxx@outlook.com',
        pass: 'xxxxxx?'
    }
});

When i try to send an email, the server responds with an error name "Error", message "Connection closed unexpectedly", stack "Error: Connection closed unexpectedly at SMTPClient._onClose (C:\Apps\myapp\node_modules\nodemailer\node_m odules\simplesmtp\lib\client.js:388:30) at Socket.EventEmitter.emit (events.js:117:20) at TCP.close (net.js:465:12)enter code here { [DeliveryError: Message delivery failed: 550 5.3.4 Requested action not taken; We noticed some unusual activity in your Hotmail account. To help protect you, we've temporarily blocked your account.]"

Someone knows how to solve this problem?

Thanks!

Cristiano Sarmento
  • 633
  • 2
  • 9
  • 19
  • 1
    By now, to solve the problem, i'm opening my email account in the web browser of the application server. Then, Hotmail or Gmail (depending in what i'm using) registers my server IP and i can send emails through NodeMailer. Thanks! – Cristiano Sarmento Mar 26 '14 at 15:27

1 Answers1

2

The problem is about locations, not about nodemailer.

Hotmail saves your usual locations and access points, and before each login, it cheks the procedence of the request.

In this case, your tring to auth via smpt from an ec2 machine located somewhere around the world.

These location is extrange for hotmail(microsoft) and it blocks the account access.

Is a security barrier.

You should have a mail in the inbox of that accont talking about a blocked access try. And how to add these location as a safe location.

It happend too with other mail providers like gmail...

jmingov
  • 13,553
  • 2
  • 34
  • 37