[Email-SIG] save .msg as .txt

Barry Warsaw barry at python.org
Sun May 8 17:27:11 CEST 2005


On Sun, 2005-05-08 at 05:39, Kalpana Sinduria wrote:

> 	no it's not in plain .txt format. it's in Microsoft's outlook message
> (.msg) format.
> 	I tired the following code, but it's not working
> 
> 	******************
> 	  import email.Parser
>         fp = open('mymail.msg', 'rb')
>         p = email.Parser.Parser()
>         msg = p.parse(fp)  ---- > error
>         fp.close()
> 	 ******************

Yeah, there's no way that's going to work.  email.Parser (really
FeedParser in 3.0) can only parse RFC 2822 messages.  The nice thing is
that if you could write a parser for MS Outlook files, you could then
use the rest of the email package to manipulate those message objects. 
Contributions are welcome. :)

-Barry

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 307 bytes
Desc: This is a digitally signed message part
Url : http://mail.python.org/pipermail/email-sig/attachments/20050508/aaf2809b/attachment.pgp


More information about the Email-SIG mailing list