diff options
author | cedricbonhomme <devnull@localhost> | 2010-11-23 11:40:56 +0100 |
---|---|---|
committer | cedricbonhomme <devnull@localhost> | 2010-11-23 11:40:56 +0100 |
commit | 6b4eff20bea59339a5f09d807e082fc2a494dd7e (patch) | |
tree | 300a8852fa05f7bb48571b0bd36c3c25d6263410 /utils.py | |
parent | Renamed pages list_notification and list_favorites to notifications and favor... (diff) | |
download | newspipe-6b4eff20bea59339a5f09d807e082fc2a494dd7e.tar.gz newspipe-6b4eff20bea59339a5f09d807e082fc2a494dd7e.tar.bz2 newspipe-6b4eff20bea59339a5f09d807e082fc2a494dd7e.zip |
Improvement of mail notification for new articles (HTML output).
Diffstat (limited to 'utils.py')
-rwxr-xr-x | utils.py | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -213,13 +213,16 @@ def tag_cloud(tags, query="word_count"): (min(1 + count * 7 / max([tag[1] for tag in tags]), 7), query, word, count, calendar.month_name[int(word)])) \ for (word, count) in tags]) -def send_mail(mfrom, mto, feed_title, message): - """Send the warning via mail +def send_mail(mfrom, mto, feed_title, article_title, description): """ - mail = MIMEText(message) + Send the article via mail. + """ + content = """<html>\n<head>\n<title>%s</title>\n</head>\n<body>\n%s\n</body>\n</html>""" % \ + (feed_title + ": " + article_title, description) + mail = MIMEText(content) mail['From'] = mfrom mail['To'] = mto - mail['Subject'] = '[pyAggr3g470r] News from ' + feed_title + mail['Subject'] = '[pyAggr3g470r] - ' + feed_title + ": " + article_title #email['Text'] = message server = smtplib.SMTP(smtp_server) |