- Django提供了发送邮件的类 django.core.mail
一、Django发送邮件流程分析
- 配置相关参数,由django的send_mail()方法向smtp服务器发送邮件信息,
- 由smtp服务器发向用户邮箱发送邮件
1、send_mail()方法介绍
- 在django.core.mail模块提供了send_mail()来发送邮件。
- send_mail(subject, message, from_email, recipient_list, html_message=None)
- subject:邮件标题
- message:普通邮件正文,普通字符串
- from_email:发件人
- recipient_list:收件人列表
- html_message:多媒体邮件正文,可以是html字符串