use strict; use warnings; use Win32::OLE; use Win32::OLE::Const 'Microsoft Outlook'; # $Win32::OLE::Warn = 3; my $outlook; $outlook = Win32::OLE->new('Outlook.Application'); die unless $outlook; my $namespace = $outlook->GetNamespace("MAPI"); my $folder = $namespace->GetDefaultFolder(6); my $items = $folder->Items; my $cnt=$items->Count; print "cnt :: $cnt \n"; for my $itemIndex (1..$items->Count) { my $message = $items->item($itemIndex); next if not defined $message; if ($message->{'Unread'}) { my $text = $message->Subject(); my $from_user; # $from_user = $from_user.$message->From(); $from_user = $from_user.$message->{'SenderEmailAddress'}; my $to_user = $message->To(); print "Unread Email from $from_user and to $to_user\n"; } }
In reply to Re: How to read only unread mail from Outlook Inbox
by Sathishkumar
in thread How to read only unread mail from Outlook Inbox
by karthik.raju
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |