Skip to content
This repository was archived by the owner on May 16, 2019. It is now read-only.

Commit 7d4dca9

Browse files
committed
Change emailes to HTML
1 parent 7710f79 commit 7d4dca9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

market/smtpnotification.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import smtplib
44
from smtplib import SMTPAuthenticationError
5+
from email.mime.multipart import MIMEMultipart
56
from email.mime.text import MIMEText
67
from log import Logger
78

@@ -38,11 +39,14 @@ def send(self, subject, body):
3839

3940
if is_enabled:
4041
# Construct MIME message
41-
msg = MIMEText(body)
42+
msg = MIMEMultipart('alternative')
4243
msg['Subject'] = subject
4344
msg['From'] = self.sender
4445
msg['To'] = self.recipient
4546

47+
html_body = MIMEText(body, 'html')
48+
msg.attach(html_body)
49+
4650
try:
4751
server = smtplib.SMTP(self.server)
4852
server.starttls()

0 commit comments

Comments
 (0)