Can't Send Emails
Pecacheu opened this issue · comments
I'm trying to send an email from my home server to a gmail account when someone clicks a button on a webpage. I have a DDNS address for my home network, and I'm trying to send the emails from there. (I don't need to forward any ports on my router, do I?)
When I try to send an email, it causes a "can not connect to any SMTP server" error. There was a closed issue about the same error, but they say they solved the issue without explaining how.
Current Behavior
This error happens when I try to send an email:
mx resolved: [ { exchange: 'alt4.gmail-smtp-in.l.google.com', priority: 40 }, { exchange: 'alt3.gmail-smtp-in.l.google.com', priority: 30 }, { exchange: 'alt2.gmail-smtp-in.l.google.com', priority: 20 }, { exchange: 'alt1.gmail-smtp-in.l.google.com', priority: 10 }, { exchange: 'gmail-smtp-in.l.google.com', priority: 5 } ] Error on connectMx for: { exchange: 'alt4.gmail-smtp-in.l.google.com', priority: 40 } { Error: connect ETIMEDOUT 64.233.186.26:25 at Object.exports._errnoException (util.js:1026:11) at exports._exceptionWithHostPort (util.js:1049:20) at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1085:14) code: 'ETIMEDOUT', errno: 'ETIMEDOUT', syscall: 'connect', address: '64.233.186.26', port: 25 } < ... More Of Same Error ... > error on connectMx Error: can not connect to any SMTP server at tryConnect (C:\Users\Pecacheu\Desktop\InstructorForm\node_modules\sendmail\sendmail.js:86:49) at Socket. (C:\Users\Pecacheu\Desktop\InstructorForm\node_modules\sendmail\sendmail.js:92:13) at emitOne (events.js:96:13) at Socket.emit (events.js:188:7) at emitErrorNT (net.js:1276:8) at _combinedTickCallback (internal/process/next_tick.js:74:11) at process._tickCallback (internal/process/next_tick.js:98:9) Error: can not connect to any SMTP server at tryConnect (C:\Users\Pecacheu\Desktop\InstructorForm\node_modules\sendmail\sendmail.js:86:49) at Socket. (C:\Users\Pecacheu\Desktop\InstructorForm\node_modules\sendmail\sendmail.js:92:13) at emitOne (events.js:96:13) at Socket.emit (events.js:188:7) at emitErrorNT (net.js:1276:8) at _combinedTickCallback (internal/process/next_tick.js:74:11) at process._tickCallback (internal/process/next_tick.js:98:9) undefined
Steps to Reproduce
The relevant code so far is basically just the example code:
const mail = require('sendmail')(); mail({ from:'no-reply@example.com', to:'testEmail@gmail.com', subject: 'SendMail API Test', html:'TEST MESSAGE', }, function(err, reply) { console.log(err && err.stack); console.dir(reply); });
Your Environment
- Version used: 1.1.1
- Environment name and version: Node v6.9.1
- Operating System and version: Windows 10 Pro
- Link to your project: Not up yet.
@Pecacheu you used a valid email when you got that issue correct?
And no you do not need to set any ports
@Pecacheu Most consumer ISPs block port 25 to prevent sending email out. That's almost certainly your issue.
Just got back to this. Yeah, port-blocking appears to be the issue. The SendMail library is working fine from our MakerSpace's extremely slow Comcast business internet.
My home internet is Cox, who seems to have an extremely long port block list, including port 80, which I swear wasn't blocked before, but after testing it defiantly is now. Also, after having to read the full ToS agreement to find this out, I've discovered several disturbing things, including the fact that the simple act of having a WD MyCloud is technically a breach-of-contract, even if you don't have it configured with DDNS or a Static IP. Oh yeah, and Cox tracks and stores your internet history and sells it to advertisers. Like as in, for money. On top of your $250/mo. contract. WTF Cox!? Apparently all the ISPs do this, though.