mail 拆分模块
增加 js 的压缩配置 修改设置,增加备案号 Squash from3dd19cftobfc4123by virusdefender
This commit is contained in:
15
utils/mail.py
Normal file
15
utils/mail.py
Normal file
@@ -0,0 +1,15 @@
|
||||
# coding=utf-8
|
||||
from envelopes import Envelope
|
||||
|
||||
from django.conf import settings
|
||||
|
||||
|
||||
def send_email(from_name, to_email, to_name, subject, content):
|
||||
envelope = Envelope(from_addr=(settings.SMTP_CONFIG["email"], from_name),
|
||||
to_addr=(to_email, to_name),
|
||||
subject=subject,
|
||||
html_body=content)
|
||||
envelope.send(settings.SMTP_CONFIG["smtp_server"],
|
||||
login=settings.SMTP_CONFIG["email"],
|
||||
password=settings.SMTP_CONFIG["password"],
|
||||
tls=settings.SMTP_CONFIG["tls"])
|
||||
Reference in New Issue
Block a user