+import traceback, smtplib
+from email.mime.text import MIMEText
+
+# Logging configuration
+syslogLevel = logging.INFO
+mailLevel = logging.CRITICAL # must be "larger" than syslog level!
+mailAddress = 'post+tuer'+'@'+'ralfj.de'
+
+# Mail logging handler
+def sendeMail(subject, text, receivers, sender='sphinx@hacksaar.de', replyTo=None):
+ if not isinstance(type(receivers), list): receivers = [receivers]
+ # construct content
+ msg = MIMEText(text.encode('UTF-8'), 'plain', 'UTF-8')
+ msg['Subject'] = subject
+ msg['From'] = sender
+ msg['To'] = ', '.join(receivers)
+ if replyTo is not None:
+ msg['Reply-To'] = replyTo
+ # put into envelope and send
+ s = smtplib.SMTP('ralfj.de')
+ s.sendmail(sender, receivers, msg.as_string())
+ s.quit()