#!/usr/bin/perl
use strict;
use warnings;
use Win32::OLE;
use Win32::OLE::Const 'Microsoft Outlook';
use Data::Dumper;
my $outlook = Win32::OLE->new('Outlook.Application') or die $!;
my $namespace = $outlook->GetNameSpace('MAPI');
my $folder = $namespace->GetDefaultFolder(6)->Folders('Archive');
my $items = $folder->Items;
foreach my $msg ( $items->in ) {
foreach my $key ( keys %{$msg} ) {
print "$key: ", $msg->{$key}, "\n";
}
print Dumper \$msg;
print "\n\n-----\n\n";
}
####
if ( defined $msg -> {$key} ) {
print "$key: ", $msg -> $key, "\n";
}
####
Class: 43
MessageClass: IPM.Note
Subject: some_subject_line_here
Sent: 1
DownloadState: 1
MarkForDownload: 1