Robert: Outlook / neue mail

Beitrag lesen

Hi,

weiss jemand wie ich mit Perl feststellen kann wann neue mail eintrifft??? Ich möchte mein Programm vor sich hin schlummern lassen und sobald eine mail kommt soll meinetwegen ein Text in der Kommandozeile ausgegeben werden.

Einen Ansatz habe ich:

------schnipp----------------------------------------
#!perl -w
use strict;
use Win32::OLE qw(EVENTS);
use Win32::OLE::Const 'Microsoft Outlook';
use Win32::OLE::Variant;
my $Outlook = Win32::OLE->GetActiveObject('Outlook.Application') || Win32::OLE->new('Outlook.Application');
sub Newmail {
  print "Something happened.\n";
}

Win32::OLE->WithEvents($Outlook, &NewMail, "Application.NewMail");
------schnapp----------------------------------------

Der tut aber noch nicht so ganz, bzw. ich bekomme eine wirre Fehlermeldung:

Win32::OLE(0.13)FindIID: Interface 'Application.NewMail' not found at C:\Dokumente und Einstellungen\win\Desktop\perl\test.pl line 11.
Win32::OLE(0.13) error 0x80004002: "Schnittstelle nicht unterst³tzt" at C:\Dokumente und Einstellungen\win\Desktop\perl\test.pl line 11

Kann mir jemand helfen????

Gruß
Robert