From bc03ef84fc85174db6c903e69e89f1af6ba74a22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominic=20K=C3=B6nig?= Date: Thu, 22 Aug 2013 22:56:23 +0200 Subject: [PATCH] Ability to send emails with empty message body. --- gluon/tools.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gluon/tools.py b/gluon/tools.py index 1361f0b8..c691a2c7 100644 --- a/gluon/tools.py +++ b/gluon/tools.py @@ -429,13 +429,13 @@ class Mail(object): html = html.decode(encoding).encode('utf-8') # Construct mime part only if needed - if text and html: + if text is not None and html: # We have text and html we need multipart/alternative attachment = MIMEMultipart.MIMEMultipart('alternative') attachment.attach(MIMEText.MIMEText(text, _charset='utf-8')) attachment.attach( MIMEText.MIMEText(html, 'html', _charset='utf-8')) - elif text: + elif text is not None: attachment = MIMEText.MIMEText(text, _charset='utf-8') elif html: attachment = \