用网易邮箱smtp发邮件时候一直报警553权限问题
smtplib.SMTPSenderRefused at:
(553, b'Mail from must equal authorized user', 'webmaster@localhost')
经过网上查阅以后发现,发送邮件时DEFAULT_FROM_EMAIL这一个设置必须写,而且内容和EMAIL_HOST_USER需要一致!
EMAIL_HOST = 'smtp.163.com'
EMAIL_HOST_USER = 'email address'
EMAIL_HOST_PASSWORD = '第三方客户端登录授权码'
EMAIL_PORT = 465 # SSL协议端口号
EMAIL_USE_SSL = True
# EMAIL_USE_TLS = True
DEFAULT_FROM_EMAIL = '这一项一定要添加'
EMAIL_FROM = '可加可不加'