Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Regarding usage of """use Mail::Outlook;"""" on 64bit OS

by ygudetti (Initiate)
on Nov 06, 2012 at 06:42 UTC ( #1002417=perlquestion: print w/replies, xml ) Need Help??
ygudetti has asked for the wisdom of the Perl Monks concerning the following question:

Hi, Using perl I wanted to read email from my outlook as soon as new email arrives then planning to implement next logic depending on the subject....

I am using Microsoft outlook 2010

I found following program from cpan but upon execution I get the following error... -------------


Can't locate Win64/OLE/ in @INC (@INC contains: ./lib C:/Perl64/site/lib C:/Perl64/lib .) at line 10. BEGIN failed--compilation aborted at line 10.

------------------- line 10 is as below------------

use Win64::OLE::Const 'Microsoft Outlook';


I tried to get related modules from PPM but failed, I am not expert but I can say I am intermediate programmer

Please suggest how to run the following program

Thanks in advance

complete program from -----------------------------
# create the object use Mail::Outlook; my $outlook = new Mail::Outlook(); # start with a folder my $outlook = new Mail::Outlook('Inbox'); # use the Win32::OLE::Const definitions use Mail::Outlook; use Win64::OLE::Const 'Microsoft Outlook'; my $outlook = new Mail::Outlook(olInbox); # get/set the current folder my $folder = $outlook->folder(); my $folder = $outlook->folder('Inbox'); # get the first/last/next/previous message my $message = $folder->first(); $message = $folder->next(); $message = $folder->last(); $message = $folder->previous(); # read the attributes of the current message my $text = $message->From(); $text = $message->To(); $text = $message->Cc(); $text = $message->Bcc(); $text = $message->Subject(); $text = $message->Body(); my @list = $message->Attach(); # use Outlook to display the current message $message->display; # 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->send; # Or use a hash my %hash = ( To => '', Cc => 'Them <>', Bcc => 'Us <>,', Subject => 'Blah Blah Blah', Body => 'Yadda Yadda Yadda', ); my $message = $outlook->create(%hash); $message->display(%hash); $message->send(%hash);

Replies are listed 'Best First'.
Re: Regarding usage of """use Mail::Outlook;"""" on 64bit OS
by marto (Archbishop) on Nov 06, 2012 at 07:15 UTC

    Where are you finding this code on cpan which suggests using Win64:: modules? I don't believe they exist, I can't find any when I search. Use Win32 even on the 64bit platform. See also What Windows 64 bit traps are out there?.

    Update: fixed some auto correct typos.

      Thanks Marto

      Can you please point me to part of perl script which can be used to read outlook email or you can send some url which can give more details (if you know any)

      Thanks again

        Can you give us more information about the task? Do you actually want to automate Outlook or are you just trying to read (and process) mail stored on the exchange server? Using Super Search will find you examples using modules such as Mail::Box, Mail::Outlook and other for automating email processing.

        Have you considered simply changing line 10 to point to a module which actually exists?

        use Win32::OLE::Const 'Microsoft Outlook';

        N.B. you will have to install this module if your Perl ditribution doesn't already have it.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1002417]
Approved by marto
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2018-06-18 23:56 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (111 votes). Check out past polls.