summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorSean Reifscheider <jafo@tummy.com>2010-03-19 23:19:55 (GMT)
committerSean Reifscheider <jafo@tummy.com>2010-03-19 23:19:55 (GMT)
commit95ce1fcf8b5a53453477bb24d046497836bab150 (patch)
tree42f0c976e07de09ddfef90cbb54fb0c5fb1bef03 /Doc/library
parentcc1d06b3aefc2d23f876be8f030dc606f926a7cf (diff)
downloadcpython-95ce1fcf8b5a53453477bb24d046497836bab150.zip
cpython-95ce1fcf8b5a53453477bb24d046497836bab150.tar.gz
cpython-95ce1fcf8b5a53453477bb24d046497836bab150.tar.bz2
Adding an example of reproducing the rfc822.Message() parsing.
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/email-examples.rst6
1 files changed, 6 insertions, 0 deletions
diff --git a/Doc/library/email-examples.rst b/Doc/library/email-examples.rst
index c1b16da..32cecf3 100644
--- a/Doc/library/email-examples.rst
+++ b/Doc/library/email-examples.rst
@@ -11,6 +11,12 @@ First, let's see how to create and send a simple text message:
.. literalinclude:: ../includes/email-simple.py
+And parsing RFC822 headers can easily be done by the parse(filename) or
+parsestr(message_as_string) methods of the Parser() class:
+
+.. literalinclude:: ../includes/email-headers.py
+
+
Here's an example of how to send a MIME message containing a bunch of family
pictures that may be residing in a directory: