Hi

I have a perl program that sends email via win32-ole cdo.
I started having the 2 dialogs since "upgrading" :-( to outlook 2003.
The dialogs read:
1. A program is trying to access e-mail addresses you have stored in Outlook. Do you want to allow this?
2. A program is trying to automatically send e-mail on your behalf. Do you want to allow this?


The last one with the 5 second delay. I have read that this is called "object model guard" and there is no registry setting to turn it off. Since this is a work computer I can not uninstall outlook 2003. I have also read that extended mapi can prevent this error. I have a C++ program that uses extended mapi to get the addresses of names and this doesnt trigger the dialogs.

So I want to change my perl code so it doesnt ask for the 2 dialogs. Anybody have any suggestions?

Here is the code which basically listens for smtp connections and forwards the email to exchange. I have snipped the smtp portion to keep it brief. If anybody wants the ocde I can include the whole program.


use Win32::OLE; use Net::SMTP::Server; use Net::SMTP::Server::Client2;

my $name = "Microsoft Outlook Internet Settings";

Win32::OLE->Initialize(Win32::OLE::COINIT_OLEINITIALIZE) ;
die "Coinitialize error", Win32::OLE->LastError(),"\n" if Win32::OLE->LastError();


$Session = Win32::OLE->new('MAPI.Session');
die "Could not create a MAPI Session: $!", Win32::OLE->LastError(),"\n" if Win32::OLE->LastError();
$Session->Logon($name, "");
die "Could not login: ", Win32::OLE->LastError(),"\n" if Win32::OLE->LastError();


my $message = $Session->Outbox->Messages->Add($Subject, $Body);

for my $recp (@{$client->{TO}}) {
  my $recipient = $message->Recipients->Add;
  $recipient->{Name} = $recp;
  $recipient->{Type} = 1; # 1 = "To:", 2 = "Cc:", 3 = "Bcc:"
  $recipient->Resolve();
}
$message->Send(1, 0, 0);
_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to