Hi Guys,

Ok, so I'm accessing our Exchange mailbox via Perl to poll for certain emails.

I open up a Win32::OLE->new("MAPI.Session") object, get the stores and so on, then I 
loop through the message collection using:

for my $msg (in $folder->Messages)
{
 # simple example
 print "Subject: ".$msg->Subject."\n";
# print "Subject: ".$msg->Text."\n";
}

If I have three emails in the mailbox, this will display the subject of each. However, 
as soon as I try to access the Text property (which is still a top-level property of 
the Message object (as per MS docs)), the Text property for message 1 *always* returns 
the wrong text - the text of the last email, like so:

-- Output for three emails

$msg->Subject = 'test 1'
$msg->Text = body of test 3 email

$msg->Subject = 'test 2'
$msg->Text = body of test 2 email

$msg->Subject = 'test 3'
$msg->Text = body of test 3 email

It's only the first email that returns the wrong text. It seems that either Exchange 
or Win32::OLE is returning the wrong data, or I've missed something fundamental...

Anybody run into this before or has a clue what's going on..?

Ben Hall
www.benhall.co.uk




_______________________________________________________________________
FSmail - Get your free web-based email from Freeserve: www.fsmail.net




_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users

Reply via email to