“[Errno 101] 网络无法访问"尝试使用 Django 发送电子邮件时 [英] "[Errno 101] Network is unreachable" when trying to send email using Django

查看:35
本文介绍了“[Errno 101] 网络无法访问"尝试使用 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://my.bluehost.com/cgi/help/500

这篇关于“[Errno 101] 网络无法访问"尝试使用 Django 发送电子邮件时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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