Email activation problem encountered in Django project

in the setting configuration    

    EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' # import mail module

    EMAIL_HOST = 'smtp.qq.com' # Email server address
    EMAIL_PORT = 465 # Email server port (default is 25)
    EMAIL_HOST_USER = '[email protected]' # Sender (Daily Fresh official email account)
    EMAIL_HOST_PASSWORD = '
    xgtvgsiixiaqcbeg ' # Client authorization code, non-mailbox login password

    EMAIL_USE_SSL=True


The configuration file is very important. It often involves the problem that different mailboxes will use different ports. However, the port problem will involve a secure connection problem, which is recorded in the official documentation (as follows):

    Default: False

    Whether to use an implicit TLS (secure) connection when communicating with the SMTP server. In most email documents, this type of TLS connection is called SSL. It is usually used on port 465. See Explicit TLS setting EMAIL_USE_TLS if you run into problems . Note that EMAIL_USE_TLS  /  EMAIL_USE_SSL are mutually exclusive, so only one of these settings can be set to True . The general port defaults to 25

EMAIL_USE_TLS

Default: False

Whether to use TLS (secure) when connecting to the SMTP server. This is for explicit TLS connections, usually on port 587. If you are experiencing hung connections, see the implicit EMAIL_USE_SSL TLS setting. This is used for explicit TLS connections, usually on port 587. If you experience hung connections, see the implicit TLS setting EMAIL_USE_SSL .



After searching, the commonly used mailboxes on the market are set as follows:

【sina.com】

POP3 server address: pop3.sina.com.cn (port: 110)
SMTP server address: smtp.sina.com.cn (port: 25) 

 

【sinaVIP】

POP3 server: pop3.vip.sina.com (port: 110)

SMTP server: smtp.vip.sina.com (port: 25)

 

【sohu.com】

POP3 server address: pop3.sohu.com (port: 110)
SMTP server address: smtp.sohu.com (port: 25)

 

【126 mailbox】

POP3 server address: pop.126.com (port: 110)

SMTP server address: smtp.126.com (port: 25)

 

【139 mailbox】

POP3 server address: POP.139.com (port: 110)

SMTP server address: SMTP.139.com (port: 25)

【163.com】

POP3 server address: pop.163.com (port: 110)
SMTP server address: smtp.163.com (port: 25)

 

【QQ mailbox】

POP3 server address: pop.qq.com (port: 110)

SMTP server address: smtp.qq.com (port: 25)

 

【QQ enterprise mailbox】

POP3 server address: pop.exmail.qq.com (SSL enabled port: 995)

SMTP server address: smtp.exmail.qq.com (SSL enabled port: 587/465)

 

【yahoo.com】

POP3 server address: pop.mail.yahoo.com
SMTP server address: smtp.mail.yahoo.com

 

【yahoo.com.cn】

POP3 server address: pop.mail.yahoo.com.cn (port: 995)
SMTP server address: smtp.mail.yahoo.com.cn (port: 587

 

【HotMail】

POP3 server address: pop3.live.com (port: 995)

SMTP server address: smtp.live.com (port: 587)

 

【Gmail】
POP3 server address: pop.gmail.com (SSL enabled port: 995)
SMTP server address: smtp.gmail.com (SSL enabled port: 587)

 

【263.net】

POP3 server address: pop3.263.net (port: 110)
SMTP server address: smtp.263.net (port: 25)

 

263.net.cn】

POP3 server address: pop.263.net.cn (port: 110)
SMTP server address: smtp.263.net.cn (port: 25)


【21cn.com】

POP3 server address: pop.21cn.com (port: 110)
SMTP server address: smtp.21cn.com (port: 25)

 

【Foxmail】

POP3 server address: POP.foxmail.com (port: 110)

SMTP server address: SMTP.foxmail.com (port: 25)

 

【china.com】

POP3 server address: pop.china.com (port: 110)

SMTP server address: smtp.china.com (port: 25)

 

【tom.com】

POP3 server address: pop.tom.com (port: 110)
SMTP server address: smtp.tom.com (port: 25)

Hope it helps you a little

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324590591&siteId=291194637