发布网友 发布时间:2022-04-22 23:21
共1个回答
热心网友 时间:2023-05-22 21:42
我以前的项目里面用到的
"""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)