django相关的可重用应用程序提供了发送多部分电子邮件并将其存储在数据库中的能力。
django-fs-email-helper的Python项目详细描述
简介
django fs email helper是django相关的可重用应用程序,提供发送多部分电子邮件并将其存储在数据库中的功能。
这个应用程序的显著特点是将发送的电子邮件存储在数据库中。这意味着你有能力检查从管理界面发送的每一封电子邮件。
安装
使用pip:
安装django-fs-email-helper。$ pip install django-fs-email-helper
将'email_helper'添加到INSTALLED_APPS设置:
INSTALLED_APPS = ( ... 'email_helper', ... )
运行syncdb或migrate:
$ ./manage.py syncdb or $ ./manage.py migrate
用法
只需导入send_email函数并使用它:
from email_helper import send_email send_email('from_email@example.com', 'to_email@example.com', 'email_helper/email_template.html', {}) send_email('from_email@example.com', ['to_email_1@example.com', 'to_email_2@example.com'], 'email_helper/email_template.html', {})