http://www.perlmonks.org?node_id=946710


in reply to Use perl to create outlook .msg file

cpan://outlook

Mail::Outlook::Message

use Mail::Outlook; my $outlook = new Mail::Outlook(); # create a message for sending my $message = $outlook->create(); $message->To('you@example.com'); $message->Cc('Them <them@example.com>'); $message->Bcc('Us <us@example.com>; anybody@example.com'); $message->Subject('Blah Blah Blah'); $message->Body('Yadda Yadda Yadda'); $message->Attach(@lots_of_files); $message->Attach(@more_files); # attachments are appended $message->Attach($one_file); # so multiple calls are allowed $message->save;

nah Email::Outlook::Message.pm - Read Outlook .msg files

http://www.fileformat.info/format/outlookmsg/# Outlook MSG file format COM stuctured storage OLE2 compound documents

So ole storage, ddg://perl OLE storage outlook .msg, ddg://site:perlmonks.org OLE storage outlook .msg

Replies are listed 'Best First'.
Re^2: Use perl to create outlook .msg file
by aravinds (Initiate) on Jan 07, 2012 at 15:39 UTC
    Hi Anonymous Monk,

    Thanks for your time.

    $message->save; saves it in the Drafts folder within Outlook, but I need the program to create a file on the harddrive as a physical file (.msg).

    Did not find any useful code snippets on the duckduckgo search engine either.
      The solution is: $message->SaveAs('C:\test.msg');
        I am getting the following error message:- Unknown sub Mail::Outlook::Message::SaveAs

      Um, go to MSDN, find the message object , look for save, save_to, etc, etc

Re^2: Use perl to create outlook .msg file
by Anonymous Monk on Jun 25, 2015 at 02:58 UTC
    I tried this, but it seems to my situation that I cannot create $outlook = new Mail::Outlook()... it always return undef... I don't know why... I have outlook 2007 and installed the perl module Email-Outlook
      You have commented on an old node, anonymously. Get a login, it's cheap, and then you can search more easily for your own posts, and get /msgs.

      You would do better to start a new post, referencing this thread, and show the code you used (see How do I post a question effectively?).

      -QM
      --
      Quantum Mechanics: The dreams stuff is made of