连接被拒绝:当我尝试从我的 linode 服务器发送电子邮件时
我有一个 django 项目,对于电子邮件设置,我使用我的个人 Gmail 帐户。当我从本地主机测试时它工作得很好。但是当我尝试使用 linode vps 时,我收到 django 的“连接被拒绝错误”。有什么想法吗?
I have a django project and for email settings I use my personal gmail account. It works just fine when Im testing from localhost. But i get "conection refused error" from django when I try from my linode vps. Any ideas ?
我的网站上也有类似的情况;事实证明,这是我的应用程序在生成电子邮件时出现的另一个错误。
在这种情况下,希望问题已得到解决,但您应该检查 SMTP 服务器日志以验证项目是否正在连接到 SMTP。如果不是,请检查
settings.py
文件中的EMAIL_*
设置。如果是,但立即断开连接,我敢打赌,您的电子邮件构建过程中(即解析send_mail
函数的参数时)出现了问题。I had a similar situation on my site; it turned out to be another error inside my application in the generation of the email.
In this case, hopefully this has been solved, but you should check your SMTP server logs to verify that the project is connecting to SMTP. If it isn't check the
EMAIL_*
settings in yoursettings.py
file. If it is, but then immediately disconnecting, I'd bet there's something failing in the building of your email (that is, in the parsing of the arguments to yoursend_mail
function).