无法连接到Gmail SMTP Linode django apache2安装程序 [英] Unable to connect to gmail smtp linode django apache2 setup
问题描述
您好,我无法连接到Google SMTP服务器.上下文是,只要用户填写表格,我的程序就会自动将反馈通过电子邮件发送给我的gmail帐户.一切正常,除了程序卡在send_mail函数中.
Hello im having difficulties connecting to google smtp server. The context is that whenever a user fills in a form , my program will automatically email me the feedback to my gmail account. Everything is working except for the fact that the program is stuck within the send_mail function.
我尝试这样做:
telnet smtp.gmail.com 25
Trying 2404:6800:4003:c03::6c...
最终将导致超时.
这是我的一些代码:
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_HOST_USER = 'xxxx@gmail.com'
EMAIL_HOST_PASSWORD = 'xxxxxx'
EMAIL_PORT = 465
EMAIL_USE_TLS = False
EMAIL_USE_SSL = True
DEFAULT_FROM_EMAIL = EMAIL_HOST_USER
SERVER_EMAIL = DEFAULT_FROM_EMAIL
w的开箱即用(django cms包)
As per out of the box from wagtail(django cms package)
我认为这可能与UFW阻止它有关,但是我尝试禁用UFW并重新启动apache2.不幸的是,这无济于事.
I thought it might have to do with my UFW blocking it , however i have tried disabling the UFW and restarting apache2 . This unfortunately does not help.
Status: active
To Action From
-- ------ ----
22/tcp ALLOW Anywhere
80/tcp ALLOW Anywhere
443/tcp ALLOW Anywhere
22/tcp (v6) ALLOW Anywhere (v6)
80/tcp (v6) ALLOW Anywhere (v6)
443/tcp (v6) ALLOW Anywhere (v6)
我真的迷路了!请帮忙 .谢谢
I am really lost! Please help . Thanks
推荐答案
默认情况下,新创建的Linode帐户限制使用邮件端口(25、465和587).
Newly created Linode accounts restrict the use of mailing ports (25, 465, and 587) by default.
为了打击垃圾邮件,默认情况下,2019年11月5日星期二之后创建的新Linode帐户具有默认限制的邮件端口(25、465和587)(请参阅我们的博客文章但是,如果您想使用Linodes发送电子邮件,则首先需要配置:
However, If you would like to use your Linodes for sending emails, you will first need to configure :
- 有效的DNS A记录和
您计划用于发送电子邮件的所有Linode的- rDNS.
- a valid DNS A record and
- rDNS for any Linodes that you plan to use to send emails.
You can see how to do that here: [source]
这篇关于无法连接到Gmail SMTP Linode django apache2安装程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!