You can do all that with Win32::OLE tailored for outlook.
Or with Win32::OLE using CDO (better if you plan to run this where no
outlook should be installed, say on the exchange server itself).
You still can develop somewhere else if you installed cdo with outlook (not
installed by default).
Oh, beware of the objects you use, don't confuse the outlook objects with
the cdo ones - they are somewhat similar but different, although porting
code from one object set to the other usually isn't difficult.

Some snippets of code using CDO:

use Win32::OLE;
use Win32::OLE::Const;
BEGIN { Win32::OLE->Initialize(Win32::OLE::COINIT_OLEINITIALIZE) }
eval { $cdo = Win32::OLE->new("MAPI.Session") };
die "Creation of CDO MAPI.Session failed" if $@;
$rcdoconst= Win32::OLE::Const->Load("Microsoft CDO");
$rcdo->Logon("","",0,0,0);      #Login with default configured profile
#Explicit logon with a dynamic profile is possible, see the cdo
documentation
#more info from MSDN or http://www.cdolive.com/start.htm

my $infostores = $cdo->{Infostores};
my $infostore = $infostores->Item("Public Folders");
my $folder = $infostore->{RootFolder};
my $folders = $folder->{Folders};
my $folder = $folders->GetFirst();

and so on.

You'll need to get the default folder for a message object (there's a
property for that), create e new object, add a subject and recipient of
correct type, and send it.
Then log off that profile, wait a bit, log on to the other mailbox, get the
default inbox folder, parse on the entries and search (and wait) for your
particular message, matching in some way (possibly you'll be able to retain
the unique ID of the object you sent, but I'm not sure, read the docs and
test). Or even on the receiving mailbox install a event handle in VBA,
triggered by the receiving of email.

Heiko

-- 
-- PREVINET S.p.A.            [EMAIL PROTECTED]
-- Via Ferretto, 1            ph  x39-041-5907073
-- I-31021 Mogliano V.to (TV) fax x39-041-5907472
-- ITALY

> -----Original Message-----
> From: Robert-Jan Mora [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, February 15, 2003 8:33 AM
> To: [EMAIL PROTECTED]
> Subject: MS exchange chain test
> 
> 
> Hello group,
> 
> I'm monitoring the exchange server (services) already but I 
> would like to
> test the chain of an exchange server (end to end test and 
> monitor that)
> Is it possible to log in to a mailbox, send an email to 
> another mailbox,
> logoff and log in to that mailbox read the last message and 
> send the mail
> back again and so on.
> When something goes wrong alert, with send page message or whatever.
> 
> Can someone point me in a direction for exchange?
> 
> Thankz.
> 
> _______________________________________________
> Perl-Win32-Admin mailing list
> [EMAIL PROTECTED]
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
> 
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to