So I have the following email settings specified:
These work just fine when deployed on Webfaction but won't work locally. The server just hangs. What could be causing this? asked 11 Mar '12, 12:15 aa56280
showing 5 of 7
show 2 more comments
|
I'm not sure why, but I was able to get around this issue by using smtplib.SMTP_SSL:
answered 13 Dec '12, 18:11 Josh |
Hello, Sometimes ISPs block outgoing connections on port 25, as an antispam measure. Ergo one needs to use authenticated SMTP on port 465, as per our documentation, to work around the problem - like Josh did. Sincerely, Valentin I. answered 28 Feb '14, 10:35 valentini |
It would be difficult to troubleshoot why it's not working localy, as we are not familiar with your local setup, but you should verify that smtp.webfaction.com resolves to the correct IP address 74.55.86.74 and that the first line is not a typo. The variable should be EMAIL_HOST.
Are you able to use another mail server, like a gmail one, successfully? If you could update your question with more info, like any possible errors or exceptions, we'd appreciate it.
You can find more about sending email with Django here and here.
@iliasr: That was a typo. The variable is EMAIL_HOST in the file. I'll make the edit. And yes, smtp.webfaction.com does resolve to 74.55.86.74.
I haven't tried Gmail. I've used the same setup for sending emails on other projects I've hosted on Webfaction in the past. For some reason, it's not working anymore.
Can you connect to smtp.webfaction.com via telnet?
You may need to specify the port, telnet smtp.webfaction.com 25
Try specifying the port in your settings.py as well. EMAIL_PORT = 25
telnet smtp.webfaction.com: Trying 74.55.86.74... telnet: connect to address 74.55.86.74: Connection refused telnet: Unable to connect to remote host
telnet smtp.webfaction.com 25 Trying 74.55.86.74...
It just hangs at "Trying..." when I specify the port for a while but then eventually comes back with the same results.
Sounds like the port is being blocked by a firewall possibly. You should be able to connect via telnet as I have specified. If you can check this and reply back with any further information.
Just checked. Nothing is being blocked from what I can tell.
Something is blocking your access. Using telnet to the server on port 25 should work. I've confirmed it from my location.