将163的25端口改为465端口开启SSL验证设置 EMAIL_USE_SSL = True
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.163.com' # 邮箱服务地址 这里是163邮箱的
EMAIL_USE_SSL = True
EMAIL_PORT = 465 # 端口号
EMAIL_HOST_USER = '' # 邮箱帐号
EMAIL_HOST_PASSWORD = '' # 邮箱密码
CONFIRM_DAYS = 7 # 有效时间
网友评论