bassplayer has asked for the wisdom of the Perl Monks concerning the following question:
I am forced to use Oulook 2000 at work. I suddenly started receiving a TON of SPAM and my administrator told me to send him the message headers from the spam so that he could get the Return-Path out of it and use it to bounce the offending email at the server level.
Not wanting to waste a bunch of time, I decided to write a short program to interact with my Outlook and extract the info I needed. I have it done (see below), but I am not able to get the return path, because I don't have the right constant. The closest thing I have found is ReplyRecipientNames. I have checked out the M$ Outlook 9.0 Object Library which is on my machine from the ActiveState install at D:\Perl\html\OLE-Browser\Browser.html, but I haven't found what I need.
I need the Return-Path or the entire message header so I can parse it out myself. Any insight out there?
#!C:/perl/bin/perl -w use strict; use Win32::OLE qw(in with); use Win32::OLE::Const 'Microsoft Outlook'; $|=1; $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 $namespace = $Outlook->GetNameSpace("MAPI") or die "Can't open MAPI + namespace: $!"; my $Folder1 = $namespace->GetDefaultFolder(olFolderInbox); my $Folder2 = $Folder1->Folders("TEST"); foreach my $item (in $Folder2->{Items}){ print $item->{'ReplyRecipientNames'} . "\n"; } exit 0;
bassplayer
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Win32::OLE Outlook help requested
by davis (Vicar) on Nov 28, 2002 at 09:41 UTC | |
by Solo (Deacon) on Dec 01, 2002 at 07:31 UTC | |
|
Re: Win32::OLE Outlook help requested
by bassplayer (Monsignor) on Dec 13, 2002 at 21:25 UTC |