Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
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
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.

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

      The solution is: $message->SaveAs('C:\test.msg');
        I am getting the following error message:- Unknown sub Mail::Outlook::Message::SaveAs

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 having an uproarious good time at the Monastery: (7)
As of 2014-10-24 07:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (130 votes), past polls