Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 748c958

Browse filesBrowse files
Document trailing newline behavior in set_content()
1 parent 9c08f40 commit 748c958
Copy full SHA for 748c958

File tree

Expand file treeCollapse file tree

1 file changed

+7
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+7
-0
lines changed

‎Doc/library/email.message.rst

Copy file name to clipboardExpand all lines: Doc/library/email.message.rst
+7Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -612,6 +612,13 @@ message objects.
612612
*content_manager* is not specified, use the ``content_manager`` specified
613613
by the current :mod:`~email.policy`.
614614

615+
Note that this method will append a newline character to the end of the
616+
content, if it wasn't passed already. For example, the following are equivalent ::
617+
618+
msg = EmailMessage()
619+
msg.set_content("hello")
620+
msg.set_content("hello\n")
621+
615622

616623
.. method:: make_related(boundary=None)
617624

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.