You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe the exception is the result of the _build_html_part method of message.py (currently starting at line 265).
As Python will evaluate a zero-length string as False in a conditional context, the subsequent calls to SafeMIMEText and set_charset are silently skipped and a None is returned.
As the RFC defines an email message body as optional, I believe a zero-length message should be allowed by this library. For my own use-case, I discovered this when setting up some automated reports to be emailed by a CI server as attachments, hence only needing a subject line and the attachments, no message body. Was very simple to workaround by adding a short message, but would like to see this be in closer compliance to the spec.
Slightly off-topic - Great job on this module, it's been extremely simple and enjoyable to work with.
The text was updated successfully, but these errors were encountered:
Please see this very short and simple gist for an example.
I believe the exception is the result of the _build_html_part method of message.py (currently starting at line 265).
As Python will evaluate a zero-length string as False in a conditional context, the subsequent calls to SafeMIMEText and set_charset are silently skipped and a None is returned.
As the RFC defines an email message body as optional, I believe a zero-length message should be allowed by this library. For my own use-case, I discovered this when setting up some automated reports to be emailed by a CI server as attachments, hence only needing a subject line and the attachments, no message body. Was very simple to workaround by adding a short message, but would like to see this be in closer compliance to the spec.
Slightly off-topic - Great job on this module, it's been extremely simple and enjoyable to work with.
The text was updated successfully, but these errors were encountered: