On 10/08/2014 02:41, luofeiyu wrote:
I am in python3.4
typ, data = x.con.fetch(b'1', '(RFC822)') #get the first email
text = data[0][1]
message = email.message_from_string(text).get('subject')
Traceback (most recent call last):
File stdin, line 1, in module
File
I am in python3.4
typ, data = x.con.fetch(b'1', '(RFC822)') #get the first email
text = data[0][1]
message = email.message_from_string(text).get('subject')
Traceback (most recent call last):
File stdin, line 1, in module
File D:\Python34\lib\email\__init__.py, line 40, in
In mailman.12805.1407635303.18130.python-l...@python.org luofeiyu
elearn2...@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
message = email.message_from_bytes(text)
I get it ,
print(message['Subject']) #can get the subject
But how can i get the body content of message?
no , message['Body'] or message['Content']
On 8/9/2014 7:01 PM, John Gordon wrote:
In mailman.12805.1407635303.18130.python-l...@python.org
think you ,i get it .
message = email.message_from_bytes(text)
print(message['Subject']) #can get the subject
But how can i get the body content of message?
message['Body'] or message['Content'] can get none.
On 8/9/2014 7:01 PM, John Gordon wrote:
In