如何在django中设置发送邮件
1个回答
2015-03-09
展开全部
我以前的项目里面用到的
"""setting 配置文件""" gmail默认端口是25
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_PORT = '25'
EMAIL_HOST_USER = ''
EMAIL_HOST_PASSWORD = ''
UserEmail=''
EMAIL_USE_TLS = True
"""调用django email方法"""
targetEmails 可以是一个email 也可以是多个 targetEmails 为一个list
send_mail(unicode('标题',"GBK"),unicode(content,"GBK"),setting.UserEmail, targetEmails,fail_silently=True)
"""setting 配置文件""" gmail默认端口是25
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_PORT = '25'
EMAIL_HOST_USER = ''
EMAIL_HOST_PASSWORD = ''
UserEmail=''
EMAIL_USE_TLS = True
"""调用django email方法"""
targetEmails 可以是一个email 也可以是多个 targetEmails 为一个list
send_mail(unicode('标题',"GBK"),unicode(content,"GBK"),setting.UserEmail, targetEmails,fail_silently=True)
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询