use strict; use Win32::OLE qw(in with); use Win32::OLE::Const 'Microsoft Outlook'; my $MailBox = 'Mailbox - WebOps'; my $count = 0; $|++; $Win32::OLE::Warn = 3; my $Outlook = Win32::OLE->GetActiveObject('Outlook.Application') or Wi +n32::OLE->new('Outlook.Application', 'Quit'); my $ol = Win32::OLE::Const->Load($Outlook); my $Inbox = $Outlook->GetNameSpace("MAPI")->Folders("$MailBox")->Folde +rs("Inbox") or die "Can't open MAPI namespace: $!"; my $personal = $Inbox->Folders("silent11's To-Do")->Folders("junk") or + die "Can't open MAPI namespace: $!"; foreach my $item (in $Inbox->{Items}){ # {Subject},{SenderName},{Bod +y}, etc...; if ($item->{Subject} eq 'SERVER ERROR: /cgi-bin/who_cares.pl - aut +oforwarded'){ $item->Move($personal) && $count++; } } print "\n$count items moved\n";
In reply to perl outlook filter by silent11
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |