16

For some reason I am getting this error when trying to send an email (with gmail) using Django.

[Errno 101] Network is unreachable

The weird part about this is that it only seems to happen when my web app is running on my server (bluehost). It works fine when locally.

Here are my email settings

EMAIL_USE_TLS = True
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_HOST_USER = '[email protected]'
EMAIL_HOST_PASSWORD = 'FakePassword'
EMAIL_PORT = 587

Any idea as to how I can fix this?

4
  • 1
    what do your smtp settings look like? Feb 19, 2013 at 3:48
  • @myusuf3 added to the original post Feb 19, 2013 at 3:53
  • Do you connect through a proxy?
    – wim
    Feb 19, 2013 at 4:02
  • 1
    For any cPanel users out there, contact support and they can open post 587 for you
    – JonPizza
    Aug 9, 2019 at 11:55

1 Answer 1

7

This is likely to have to do with the port you are trying to send email from on the blue host machine.

They probably block ports like that for security reasons.

More info: https://my.bluehost.com/cgi/help/500

3
  • I think this is the problem... Checking with their support now. Thanks Feb 19, 2013 at 4:27
  • I'm having a similar problem. Did you found a solution to this?
    – Segev
    May 5, 2013 at 15:14
  • Yes, it turned out that Bluehost blocks the port that gmail required. I just ended up using bluehosts email service instead. May 24, 2013 at 15:20

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.