Hi all,

I am using perl on windows and would like to know how to create an outlook email file (.msg)?

Essentially, what I need to create is a file exactly equal to one created by this process:
1. You compose an email in outlook
2. Add To, CC, Subject, HTML Body and do not send it yet but save it as a .msg file on hard-drive.
3. When you open the .msg file from your hard-drive, it automatically opens the email in edit mode and its ready for you to review/send.

Now, I have already written another perl program which auto generates the To,CC,Subject and HTML Body of the email. I need to know how to use PERL to create a .msg file with this information in it, on the hard-drive. I do not want PERL to actually send the message - it just has to create this editable .msg file.

The reason I don't want to send the email but rather create a .msg file is because the system in which these perl programs run does not have outlook configured (cannot be configured due to firewall/designed to not be able to access Exchange Server, although Outlook is installed on this system) and therefore I need PERL to just create the .msg file which I can copy over to another system where I can just open it in Outlook installed there and review it/send it.

I have already looked at other Outlook related posts in perlmonks but did not find one dealing with just creating a msg file as opposed to actually sending the email.

Appreciate if you can help

Thanks

In reply to Use perl to create outlook .msg file by aravinds

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.