my ($server, $alias, $rconn) = @_; # connect to mailbox of CN $alias using server $server my $mapikey = "$server\n$alias"; my $err; my $session = Win32::OLE->new(qw(Win32::OLE->new(qw(MAPI.Session)))) or die Win32::OLE->LastError(); # Try to logon with dynamic profile under current account. # This may need a reasonable current CDO on your machine. my $mapi = $session->Logon(undef,undef,undef,1,undef,undef,$mapikey); return $err if $err = Win32::OLE->LastError();