(535, '5.7.12 SMTP access disabled'),邮箱的SMTP都开了,我发件的是新浪,收件的试过qq,新浪,网易都不好用

来源:6-9 用户注册-3

慕仰2882131

2018-07-15

 http://img.mukewang.com/szimg/5b4a29f200010cc410410412.jpg

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"


你把这个复制上去 然后邮箱和密码填写一下然后再试试

0
2
bobby
回复
朗月清风
有报错信息吗? 如果有报错信息截图我看看 不同的同学 报错信息可能不一样
2019-07-25
共2条回复

bobby

2018-07-16

你这个是在本地调试还是在阿里云上调试的?

0
4
bobby
回复
慕仰2882131
如果出现这个是代表有异常了,你可以运行看看具体的报错信息是什么
2019-03-13
共4条回复

Python3.6+django+xadmin,打造在线教育平台

【毕设】Python 2.7到3.6 完美适配,Django升级2.0

3677 学习 · 4038 问题

查看课程