开启邮箱tls支持

pull/6/head
nineven 4 years ago
parent 97b5a23dba
commit 46a89416bc
  1. 4
      fir_ser/api/utils/sendmsg/emailApi.py
  2. 1
      fir_ser/fir_ser/settings.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:

@ -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 <noreply@hehegames.cn>',

Loading…
Cancel
Save