File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55from email .mime .multipart import MIMEMultipart
66from email .mime .text import MIMEText
77from email .utils import formataddr
8+ from email .utils import make_msgid
89from smtplib import SMTP_SSL , SMTPException
910from typing import List
1011
@@ -147,12 +148,16 @@ def send(self) -> None:
147148
148149 # This message is sent from Python."""
149150
150- BODY_TEXT = ("BCOP TEST TEST" )
151151
152152 msg = MIMEMultipart ('alternative' )
153153 msg ['Subject' ] = SUBJECT
154- msg ['From' ] = formataddr ((SENDERNAME , sender_email ))
154+ #msg['From'] = formataddr((SENDERNAME, sender_email))
155+ msg ['From' ] = SENDERNAME
155156 msg ['To' ] = receiver_email
157+ email_id = make_msgid ()
158+ msg ['Message-Id' ] = email_id
159+ msg ['References' ] = email_id
160+ msg ['In-Reply-To' ] = email_id
156161 msg .add_header ('reply-to' , reply_to_email )
157162 if len (cc_emails ) > 0 :
158163 msg ['CC' ] = "," .join (cc_emails )
You can’t perform that action at this time.
0 commit comments