diff options
author | Jörg Frings-Fürst <debian@jff.email> | 2019-07-14 16:56:34 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff.email> | 2019-07-14 16:56:34 +0200 |
commit | 4d9fabf827de7bbfd10470529a46b8e3b6a062ca (patch) | |
tree | e5416e47b0fabe697e70bb902bc9b1e5e98cb2d5 /mwc.py | |
parent | 3e926e08d444e0f1d52468e2341277c36a194880 (diff) | |
parent | 749921d2ce9862143db6ef80a6acc7c803d9f0f7 (diff) |
Merge branch 'release/debian/2.0.5-1'HEADdebian/2.0.5-1master
Diffstat (limited to 'mwc.py')
-rwxr-xr-x | mwc.py | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -4,6 +4,8 @@ # Copyright: (2013-2017) Michael Till Beck <Debianguru@gmx.de> # License: GPL-2.0+ +#test + import io from lxml import etree import hashlib @@ -78,7 +80,7 @@ def sendmail(receiver, subject, content, sendAsHtml, link, encoding=None): else: if link is not None: content = link + '\n\n' + content - mail = MIMEText(content, 'text', encoding) + mail = MIMEText(content, 'plain', encoding) mail['From'] = config.sender mail['To'] = receiver @@ -93,7 +95,7 @@ def sendmail(receiver, subject, content, sendAsHtml, link, encoding=None): if config.smtpusername is not None: mailsession.login(config.smtpusername, config.smtppwd) - mailsession.sendmail(config.sender, receiver.split(','), mail.as_string()) + mailsession.send_message(mail) # returns a list of all content that is stored locally for a specific site @@ -170,7 +172,7 @@ def pollWebsites(): sessionHashes.append(contenthash) changedContents.append(content) - subject = '[' + site['name'] + '] ' + content.title + subject = '[' + site['name'] + '] ' + ("Update available" if content.title is None else content.title) print(' ' + subject) if config.enableMailNotifications and len(fileHashes) > 0: sendAsHtml = (content.contenttype == 'html') |