Replace From header if incorrectly set
This commit is contained in:
parent
d4b63d78eb
commit
0ba7955b9e
1 changed files with 2 additions and 0 deletions
|
@ -20,6 +20,8 @@ class SMTP:
|
||||||
def send_message(self, message, *args, **kwargs):
|
def send_message(self, message, *args, **kwargs):
|
||||||
if not message.get("From"):
|
if not message.get("From"):
|
||||||
message["From"] = self.sender
|
message["From"] = self.sender
|
||||||
|
elif message["From"] == "None":
|
||||||
|
message.replace_header("From", self.sender)
|
||||||
|
|
||||||
self.connection.send_message(message, *args, **kwargs)
|
self.connection.send_message(message, *args, **kwargs)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue