Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

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

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


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?).

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

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (7)
As of 2015-07-31 03:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (274 votes), past polls