use Win32::OLE; use Win32::OLE::Const '.*Outlook'; # load the relevant constants my $ol = new Win32::OLE 'Outlook.Application'; my $inspectors = $ol->Inspectors; my @inspectors = Win32::OLE::Enum->new( $inspectors )->All; my @mail_items = grep { $_->Class == olMail } map { $_->CurrentItem } # get the MailItem object @inspectors;