(535, '5.7.12 SMTP access disabled'),邮箱的SMTP都开了,我发件的是新浪,收件的试过qq,新浪,网易都不好用
来源:6-9 用户注册-3
慕仰2882131
2018-07-15
setting里配置:
#发邮件需要的设置
EMAIL_USE_TLS = False
EMAIL_HOST = "smtp.sina.com"
EMAIL_HOST_USER = "cherish_chenming@sina.com"
EMAIL_HOST_PASSWORD = "!23qweasd"
EMAIL_PORT = 25
EMAIL_FROM = "cherish_chenming@sina.com"
发送邮件函数
def send_register_email(email,send_type):
email_record = EmailVerifyRecord()
code = "KWFUIH8274872432FEF"
email_record.code = code
email_record.email = email
email_record.send_type = send_type
email_record.save()
email_title = ""
email_body = ""
if send_type == "register":
email_title = u"在线注册激活链接"
email_body = u"请点击下面的链接激活你的账号:http:127.0.0.1:8000/active/{0}".format(code)
send_status = send_mail(email_title, email_body, EMAIL_FROM, [email])
if send_status:
pass
2回答
-
bobby
2018-07-18
EMAIL_HOST = "smtp.sina.com"
EMAIL_PORT = 587
EMAIL_HOST_USER = "cherish_chenming@sina.com"
EMAIL_HOST_PASSWORD = "xxx"
EMAIL_USE_TLS= True
EMAIL_FROM = "cherish_chenming@sina.com"你把这个复制上去 然后邮箱和密码填写一下然后再试试
022019-07-25 -
bobby
2018-07-16
你这个是在本地调试还是在阿里云上调试的?
042019-03-13
相似问题