Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #75965

Re: how to get the subject of email?

From John Gordon <gordon@panix.com>
Newsgroups comp.lang.python
Subject Re: how to get the subject of email?
Date 2014-08-10 02:01 +0000
Organization PANIX Public Access Internet and UNIX, NYC
Message-ID <ls6jp2$feg$2@reader1.panix.com> (permalink)
References <mailman.12805.1407635303.18130.python-list@python.org>

Show all headers | View raw


In <mailman.12805.1407635303.18130.python-list@python.org> luofeiyu <elearn2014@gmail.com> writes:

> message = email.message_from_string(str(text)).get('subject')
> message  # nothing displayed

Try using email.message_from_bytes() instead.

Also have a look at
http://stackoverflow.com/questions/19508393/python-email-parsing-issue
for a question very similar to yours.  Perhaps something in the code
will help.

-- 
John Gordon         Imagine what it must be like for a real medical doctor to
gordon@panix.com    watch 'House', or a real serial killer to watch 'Dexter'.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

how to get the subject of email? luofeiyu <elearn2014@gmail.com> - 2014-08-09 18:41 -0700
  Re: how to get the subject of email? John Gordon <gordon@panix.com> - 2014-08-10 02:01 +0000
    Re: how to get the subject of email? luofeiyu <elearn2014@gmail.com> - 2014-08-09 22:37 -0700
    Re: how to get the subject of email? luofeiyu <elearn2014@gmail.com> - 2014-08-09 22:52 -0700

csiph-web