tcox has asked for the wisdom of the Perl Monks concerning the following question:

Hello All,

I am trying to put together a perl script that will create appointments on an Exchange 5.5 box but am having trouble with the code. My first issue is when executing the following:

$MAPI = Win32::OLE->new('MAPI.Session'); die "Could instantiate MAPI Session: " . Win32::OLE::LastError() if (! + defined($MAPI));
generates a 0x800401f3 error which is "Invalid class string." Does anyone have any information about this?

Thanks,

tcox

BazB fixed formatting and added code tags.

Replies are listed 'Best First'.
Re: CDO problems
by esskar (Deacon) on Mar 11, 2004 at 23:55 UTC
    it doesn't seem to be a Perl problem, since the vbs code
    Dim mapi Set mapi = CreateObject("MAPI.Session")
    throws an error also, at least on my XP machine

    Update:
    this may work for you!
    my $outlook = Win32::OLE->new('Outlook.Application') or die $!;
Re: CDO problems
by maa (Pilgrim) on Mar 12, 2004 at 07:26 UTC
    Hi,

    You could try instantiating a CDONTS.NewMail or CDOSYS.NewMail instead. There was a security issue with enabling MAPI.Session directly (IIRC) and I think it is now deprecated.

    HTH - Mark