本文介绍了“[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' EMAIL_HOST_USER = 'email@gmail' 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.
更多信息:my.bluehost/cgi/help/500
更多推荐
“[Errno 101] 网络无法访问"尝试使用 Django 发送电子邮件时
发布评论