in reply to downloading email saving as outlook compattible file WIN32

PugSA:

If I understand you correctly, you just want to retrieve the EMail and store it in a format that Outlook can read. If that's the case, you don't need the MIME tools. If you save the body with the 'txt' extension, Outlook doesn't bother to decode the MIME stuff inside. If you save the body of the EMail with the appropriate extension (.eml), I believe that Outlook will be able to read it and decipher the MIME content properly.

If, on the other hand, you want to manipulate the contents, then you'll definitely want to use the MIME tools on CPAN. I've never used them to disassemble an EMail message, but I used them to create FAXes. (We have a FAX server that will take RTF or HTML (among other formats) MIME-encoded EMails and fax them to the specified addressee.

I'm no MIME expert, but I tend to think of MIME-encoded EMails as a manilla folder, with simple text on the front. That text is the text-only part of the EMail, including the headers. Then, inside the folder is a collection of named pages, typically (but not always) encoded. The top line of the page tells you the name of the page, as well as a description of what you'll see when it's decoded, and the encoding scheme used.

It's not too difficult to figure out--but I found the documentation a bit obtuse, so I experimented a lot by taking apart some EMails to see what was in them, and manipulating them in an editor.

One hint: Outlook tries to be too clever, so in most cases, it makes it impossible to get the unmodified body of the EMail received. So you might want to consider a different EMail client for your experiments. (I used Netscape's EMail client, which doesn't change your EMail contents when saving them to a text file for you.) Once you get to the point where you can take the EMails apart and put 'em back together, then you can switch back to Outlook to verify your work.

If you're interested, /msg me and tomorrow when I get back to work, I'll post my fax code to the Snippets section. Of course, it's me *creating* an EMail to be sent, and not taking one apart, so you may not find it interesting...

--roboticus

  • Comment on Re: downloading email saving as outlook compattible file WIN32