use the SMTP library as advertised
authorThierry Parmentelat <thierry.parmentelat@inria.fr>
Fri, 3 Nov 2023 13:06:49 +0000 (14:06 +0100)
committerThierry Parmentelat <thierry.parmentelat@inria.fr>
Fri, 3 Nov 2023 13:06:49 +0000 (14:06 +0100)
PLC/sendmail.py

index 86cee36..d4a0a2a 100644 (file)
@@ -93,10 +93,10 @@ def sendmail(api, To, Subject, Body, From=None, Cc=None, Bcc=None):
 
     s = SMTP()
     s.connect()
-    s.close()
     rejected = s.sendmail(
         from_addrs[0], to_addrs,
         msg.as_string(), rcpt_options=["NOTIFY=NEVER"])
+    s.quit()
 
     if rejected:
         raise PLCAPIError("Error sending message to "