diff options
| author | Markus Krogh <markus@nordu.net> | 2016-11-21 10:34:08 +0100 |
|---|---|---|
| committer | Markus Krogh <markus@nordu.net> | 2016-11-21 10:34:08 +0100 |
| commit | 0883062711f7cdfaa415b978be1f22665556a0bb (patch) | |
| tree | 148400048f1d10ba1c93fe8698cfaf34b2d1545b | |
| parent | c9ff7cb5897c12fc5f554e4750f07d2f0d9911f1 (diff) | |
Fix mail errorsv1.2
| -rw-r--r-- | maconomy/mailer.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/maconomy/mailer.py b/maconomy/mailer.py index 28a2d53..16d5773 100644 --- a/maconomy/mailer.py +++ b/maconomy/mailer.py @@ -12,7 +12,11 @@ class Mailer: msg['To']=to msg['From']=self.me msg['Subject'] = subject - self.server.sendmail(self.me, to, msg.as_string()) + try: + self.server.sendmail(self.me, to, msg.as_string()) + except Exception e: + print(u"Error sending mail to: {}. Got error: {}".format(to, str(e))) + def close(self): self.server.quit() |
