Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Re: Use perl to create outlook .msg file

by Anonymous Monk
on Jan 07, 2012 at 03:53 UTC ( #946710=note: print w/ replies, xml ) Need Help??

in reply to Use perl to create outlook .msg file



use Mail::Outlook; my $outlook = new Mail::Outlook(); # create a message for sending my $message = $outlook->create(); $message->To(''); $message->Cc('Them <>'); $message->Bcc('Us <>;'); $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 - Read Outlook .msg files Outlook MSG file format COM stuctured storage OLE2 compound documents

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

Comment on Re: Use perl to create outlook .msg file
Download Code
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?).

      Quantum Mechanics: The dreams stuff is made of

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://946710]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2015-11-27 04:50 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (718 votes), past polls