Fix headers method to handle single recipient as a string

This commit is contained in:
Edgar P. Burkhart 2025-05-16 23:21:09 +02:00
parent 65e449494d
commit 84fdb3d499
Signed by: edpibu
GPG key ID: 9833D3C5A25BD227

View file

@ -172,6 +172,8 @@ class MicromailClient:
self.write(f"Subject: {headers['subject']}\r\n".encode())
to = headers.get("to", self.to)
if isinstance(to, str):
to = [to]
self.write(f"To: {', '.join(to)}\r\n".encode())
def write_message(self, content):