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


In reply to Re: downloading email saving as outlook compattible file WIN32 by roboticus
in thread downloading email saving as outlook compattible file WIN32 by PugSA

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.