Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

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

C:\Automation\OutlookPERL>perl reademail.pl

Can't locate Win64/OLE/Const.pm in @INC (@INC contains: ./lib C:/Perl64/site/lib C:/Perl64/lib .) at reademail.pl line 10. BEGIN failed--compilation aborted at reademail.pl 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 cpan.org -----------------------------
# 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('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->send; # Or use a hash my %hash = ( To => 'you@example.com', Cc => 'Them <them@example.com>', Bcc => 'Us <us@example.com>, anybody@example.com', Subject => 'Blah Blah Blah', Body => 'Yadda Yadda Yadda', ); my $message = $outlook->create(%hash); $message->display(%hash); $message->send(%hash);

Comment on Regarding usage of """use Mail::Outlook;"""" on 64bit OS
Download Code
Re: Regarding usage of """use Mail::Outlook;"""" on 64bit OS
by marto (Bishop) 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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (13)
As of 2014-12-19 09:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (75 votes), past polls