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);
In reply to Regarding usage of """use Mail::Outlook;"""" on 64bit OS by ygudetti
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |