From 46a89416bc1058d80d971c4afdd8ac07c89514f4 Mon Sep 17 00:00:00 2001 From: nineven Date: Sun, 31 Jan 2021 16:03:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=80=E5=90=AF=E9=82=AE=E7=AE=B1tls?= =?UTF-8?q?=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fir_ser/api/utils/sendmsg/emailApi.py | 4 +++- fir_ser/fir_ser/settings.py | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/fir_ser/api/utils/sendmsg/emailApi.py b/fir_ser/api/utils/sendmsg/emailApi.py index ae38647..455811d 100644 --- a/fir_ser/api/utils/sendmsg/emailApi.py +++ b/fir_ser/api/utils/sendmsg/emailApi.py @@ -9,11 +9,12 @@ from django.core.mail import send_mail class EmailMsgSender(object): - def __init__(self, email_host, email_port, subject, username, password, form, template_code): + def __init__(self, email_host, email_port, use_tls, subject, username, password, form, template_code): self.email_host = email_host self.email_port = email_port self.username = username self.password = password + self.use_tls = use_tls self.form = form self.subject = subject self.template_code = template_code @@ -26,6 +27,7 @@ class EmailMsgSender(object): settings.EMAIL_HOST_USER = self.username settings.EMAIL_HOST_PASSWORD = self.password settings.EMAIL_FROM = self.form + settings.EMAIL_USE_TLS = self.use_tls def send_msg(self, template_code, email, code): try: diff --git a/fir_ser/fir_ser/settings.py b/fir_ser/fir_ser/settings.py index 590748a..10ffba4 100644 --- a/fir_ser/fir_ser/settings.py +++ b/fir_ser/fir_ser/settings.py @@ -235,6 +235,7 @@ THIRD_PART_CONFIG = { 'auth': { 'email_host': 'smtp.hehegames.cn', 'email_port': '25', + 'use_tls': False, 'username': 'git@hehegames.cn', 'password': 'QE.54272cd.ecQ.wSj', 'form': 'FlyApp Validation ',