“[Errno 101] Network is unreachable”当尝试使用Django发送电子邮件 [英] "[Errno 101] Network is unreachable" when trying to send email using Django

查看:3041
本文介绍了“[Errno 101] Network is unreachable”当尝试使用Django发送电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于某种原因,当尝试使用Django发送电子邮件(使用gmail)时,我收到此错误。

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

[Errno 101] Network is unreachable

这个奇怪的部分是,只有当我的网络应用程序才会发生在我的服务器上运行(bluehost)。

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.

这是我的电子邮件设置

EMAIL_USE_TLS = True
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_HOST_USER = 'email@gmail.com'
EMAIL_HOST_PASSWORD = 'FakePassword'
EMAIL_PORT = 587

有什么想法可以解决这个问题?

Any idea as to how I can fix this?

推荐答案

这可能与您尝试从蓝色主机发送电子邮件的端口有关。

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.

更多信息: https://我的.bluehost.com / cgi / help / 500

这篇关于“[Errno 101] Network is unreachable”当尝试使用Django发送电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆