simple script to read and output Mailbox body to file.

Chuck Amadi chuck at
Tue Jun 8 17:48:51 CEST 2004

This now works ! as you stated below.Now all the body messages is this down 
using bodies [] list.

Cheers Chuck

mbox = mailbox.UnixMailbox(fp)
for mail in mbox:
	msg = email.message_from_file(mail)
	print `mail` #backticks
	print mail['Subject']
	print mailget_content_type()
	break #just look at one message

Gives me this:

chuck at sevenofnine:~/pythonScript> python
WWW Survey
Country you are currently working in:<country>UNITED STATES</country>
Postal code or ZIP Code of your facility if you know it:<zipcode>
Your Profession:<profession>Nurse</profession>
How long you have been qualifed:<qualified>< 1 Year</qualified>
Is Wound Management Your primary role:<iswoundmgt>A major part of your daily 
Specific area of interest in the list below:<specificareas>Veterinary 
Do you read a paper – based wm journal:<journal>Yes</journal>
If Yes your comments:<jcomments>bugs news</jcomments>
Favorite topics in the World Wide Wounds:<favorite>['Dressings information', 
Further Information: required:<furtherinfo>all covered really</furtherinfo>
Your Email Address:<email>it at</email>

that works, then I done this 

msg.get_payload() should return the body. How about all the body messages in 


More information about the Python-list mailing list