use Win32::OLE; use Win32::OLE::Variant; use Win32::OLE::Const 'Microsoft Outlook'; # set up OLE my $mailboxname = "Your Mailbox Name Here"; my $Outlook; eval {$Outlook = Win32::OLE->GetActiveObject('Outlook.Application')}; die "Outlook not installed" if $@; unless (defined $Outlook) { $Outlook = Win32::OLE->new('Outlook.Application', sub {$_[0]->Quit;}) or die "Can't start Outlook"; } my $namespace = $Outlook->GetNamespace("MAPI"); # open folder and open 10th message my $Folder = $namespace->Folders($mailboxname)->Folders("Inbox") || die "Can't open inbox\n"; my $n = $Folder->Items->Count; print "$n items\n"; my $msg = $Folder->Items(10); my $text = $msg->{Body}; print $text; $msg->Display; undef $Outlook;