Prevent to send email with subject

darcs-hash:20070619194416-86b55-897322bd4ab57664da46e20afd5a3bc6befe5a8a.gz
This commit is contained in:
David Rousselie
2007-06-19 21:44:16 +02:00
parent 9da0d0a7d1
commit 65386a62c3

View File

@@ -637,6 +637,8 @@ class SMTPAccount(Account):
def create_email(self, from_email, to_email, subject, body): def create_email(self, from_email, to_email, subject, body):
"""Create new email""" """Create new email"""
email = MIMEText(body) email = MIMEText(body)
if subject is None:
subject = ""
email['Subject'] = Header(str(subject)) email['Subject'] = Header(str(subject))
email['From'] = Header(str(from_email)) email['From'] = Header(str(from_email))
email['To'] = Header(str(to_email)) email['To'] = Header(str(to_email))