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 ',