some fixes
This commit is contained in:
20
wichteln.py
20
wichteln.py
@ -4,15 +4,15 @@
|
||||
import random
|
||||
import smtplib
|
||||
|
||||
DEBUG = False
|
||||
DEBUG = True
|
||||
|
||||
def sendmail(sender, receiver, msg):
|
||||
smtp = None
|
||||
try:
|
||||
smtp = smtplib.SMTP("localhost")
|
||||
smtp.sendmail("nobody@hotti.de", (receiver), msg);
|
||||
except SMTPException:
|
||||
print("Fehler beim Senden der Mail an {0}".format(self.name))
|
||||
smtp.sendmail("nobody@hottis.de", (receiver), msg)
|
||||
except smtplib.SMTPException as e:
|
||||
print("Fehler beim Senden der Mail an {0}, {1}, {2}".format(msg, receiver, e))
|
||||
raise Exception("Nochmal von vorne")
|
||||
finally:
|
||||
if smtp:
|
||||
@ -49,7 +49,7 @@ class Wichtelee(object):
|
||||
To: {0} <{1}>
|
||||
Subject: Wichteln
|
||||
|
||||
Du, {0}, darfst ein Geschenk für {2} besorgen.
|
||||
Du, {0}, darfst ein Geschenk fuer {2} besorgen.
|
||||
|
||||
Der Geist der Weihnacht
|
||||
""".format(self.name, self.email, self.receiverName)
|
||||
@ -63,10 +63,10 @@ Der Geist der Weihnacht
|
||||
|
||||
|
||||
wichtelees = [
|
||||
Wichtelee("Wolfgang", "woho@hottis.de", ("Patty", "Matthias", "Anna")),
|
||||
Wichtelee("Patty", "patty@hottis.de", ("Wolfgang", "Matthias", "Anna")),
|
||||
Wichtelee("Matthias", "matthias@hottis.de", ("Wolfgang", "Patty", "Anna", "Robert")),
|
||||
Wichtelee("Anna", "anna@hottis.de", ("Wolfgang", "Patty", "Matthias", "Lucia")),
|
||||
Wichtelee("Wolfgang", "wolfgang.hottgenroth@icloud.com", ("Patty", "Matthias", "Anna")),
|
||||
Wichtelee("Patty", "patricia.hottgenroth@icloud.com", ("Wolfgang", "Matthias", "Anna")),
|
||||
Wichtelee("Matthias", "matthias.hottgenroth@icloud.com", ("Wolfgang", "Patty", "Anna", "Robert")),
|
||||
Wichtelee("Anna", "anna.hottgenroth@icloud.com", ("Wolfgang", "Patty", "Matthias", "Lucia")),
|
||||
Wichtelee("Thomas", "thomas@nober.de", ("Sandra")),
|
||||
Wichtelee("Sandra", "sandra.nober@web.de", ("Thomas")),
|
||||
Wichtelee("Philipp", "philipp@nicolai.eu", ("Barbara")),
|
||||
@ -109,7 +109,7 @@ for first in wichtelees:
|
||||
|
||||
|
||||
notarMsg = """Subject: Wichtelergebnis
|
||||
To: Papa <heribert-ludger@nober.de
|
||||
To: Papa <heribert-ludger@nober.de>
|
||||
From: Wolfgang <woho@hottis.de>
|
||||
|
||||
Bitte gut aufheben und keinem zeigen!
|
||||
|
Reference in New Issue
Block a user