From 1f4a69de18067a2d7c20a31fb40f9fe90779082c Mon Sep 17 00:00:00 2001 From: Ronald Schaten Date: Thu, 21 Mar 2013 21:42:28 +0100 Subject: [PATCH] fixed encoding of digest-mails --- atomstrom.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/atomstrom.py b/atomstrom.py index 0644918..6ba6ceb 100755 --- a/atomstrom.py +++ b/atomstrom.py @@ -182,10 +182,16 @@ def mail_daily_digest(session, sender, receiver, prefix): link = entry.link if entry.resolvedlink: link = entry.resolvedlink - body = body + '=> %s - %s\n' % (entry.firstfetched.strftime('%y%m%d-%H%M'), feedinfo.title) - body = body + ' %s\n' % entry.title - body = body + '%s\n' % get_entry_text(entry)[0:100] - body = body + '%s\n\n' % link + try: + body = body + '=> %s - %s\n' % (entry.firstfetched.strftime('%y%m%d-%H%M'), feedinfo.title) + body = body + ' %s\n' % entry.title.decode('latin-1') + body = body + '%s\n' % get_entry_text(entry)[0:100] + body = body + '%s\n\n' % link + except: + print 'ERROR processing entry %s' % entry.id; + print sys.exc_info() + print 'not sending mail' + return if count > 0: today = datetime.now() subject = '%s (%s) - %d entries' % (today.strftime('%y%m%d'), today.strftime('%A'), count)