Browse Source

Mailversand mit Outlook/Exchange

Robert Bedner 3 years ago
parent
commit
587262d6d3
2 changed files with 16 additions and 2 deletions
  1. 1 1
      gctools/dispatch.py
  2. 15 1
      gctools/mail.py

+ 1 - 1
gctools/dispatch.py

@@ -102,4 +102,4 @@ def main(xml_filename, recipient=None, report=None, cube=None):
 
 
 if __name__ == '__main__':
-    main('GAPS_Vers_Tag', 'robert.bedner2@gmail.com')
+    main('GAPS_Vers_Tag', 'robert.bedner@gmail.com')

+ 15 - 1
gctools/mail.py

@@ -16,6 +16,20 @@ class Message:
     attachment: list
 
 
+class SMTP_365:
+    def __init__(self, host='', port=0, local_hostname=None,
+                 timeout=30,
+                 source_address=None):
+        pass
+
+    def login(self, user, password, *, initial_response_ok=True):
+        pass
+
+    def sendmail(self, from_addr, to_addrs, msg, mail_options=(),
+                 rcpt_options=()):
+        pass
+
+
 class mail:
     connected = False
 
@@ -49,7 +63,7 @@ class mail:
         return self
 
     def __exit__(self, exc_type, exc_val, exc_tb):
-        if self.mailserver.connected:
+        if self.connected:
             self.mailserver.quit()
 
     def send(self, mailto, subject, html, attachment=None):