ming 3 năm trước cách đây
mục cha
commit
7b8f8c1ee9
1 tập tin đã thay đổi với 6 bổ sung0 xóa
  1. 6 0
      api/mailer.py

+ 6 - 0
api/mailer.py

@@ -20,7 +20,13 @@ def send(msg_in):
 
     msg = MIMEMultipart()
     msg['Subject'] = 'AI Spokesgirl 服務餘額不足 '
+    
+    msgAlternative = MIMEMultipart('alternative')
+    msg.attach(msgAlternative)
+
     text = MIMEText(msg_in,'html','utf-8')
+
+    msgAlternative.attach(text)
     try:
         server = smtplib.SMTP_SSL('smtp.gmail.com', 465)
         server.ehlo()