Hello all,

I am currently working on retrieving a POP account that will have some stock quota data in it for clients and sent out several times aday. I am using the use Mail::POP3Client module. All is working fine, except I need to strip out all but the body of the message, removing all the mail header data as this is not needed. Below is a sample of the test script and a sample of one of the emails retrieved from this POP account.

# TEST SCRIPT:
# ===========================================
#!/usr/local/bin/perl
BEGIN { open (STDERR,">./mailpop_error.log"); }
use CGI::Carp qw(fatalsToBrowser);
use CGI qw/:standard/;
use Mail::POP3Client;
use strict;

print header('text/plain');

my $pop = new Mail::POP3Client('USER' => 'account_username',
'PASSWORD' => 'account_pass',
'HOST' => 'domain_name.com',
'TIMEOUT' => '60',
'AUTH_MODE' => 'BEST',
'PORT' => '110'
);

$pop->Alive() or die "POP3 connection doesn't work.";
my $count = $pop->Count();
if ($count > 0) {
my @mails = ();
for(my $i = 1; $i <= $count; $i++ ) {
$mails[$i] = $pop->Retrieve($i);
print "$mails[$i]\n";
# $pop->Delete($i);
}
$pop->Close();
}
print "\nPOP process completed. Total Emails: $count\n";
exit();
# END OF SCRIPT
# ===================================

A Sample email received. Need to strip all the email mail header data so I end up with just the body of the message.

#START OF MESSAGE
# ================================
Return-path: <[EMAIL PROTECTED]>
Envelope-to: [EMAIL PROTECTED]
Delivery-date: Tue, 03 Sep 2002 13:24:53 -0400
Received: from hall.mail.mindspring.net ([207.69.200.60])
by justlightening.justlightening.net with esmtp (Exim 3.35 #1)
id 17mHQ5-0008Vk-00
for [EMAIL PROTECTED]; Tue, 03 Sep 2002 13:24:53 -0400
Received: from user-119aek4.biz.mindspring.com ([66.149.58.132] helo=dbc.com)
by hall.mail.mindspring.net with smtp (Exim 3.33 #1)
id 17mHQl-0005Fo-00
for [EMAIL PROTECTED]; Tue, 03 Sep 2002 13:25:35 -0400
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: IBM last trade at 73.20
Message-Id: <[EMAIL PROTECTED]>
Date: Tue, 03 Sep 2002 13:25:35 -0400
Status: R
# BODY OF MESSAGE ONLY NEEDED
IBM Limit (73.20) Downside on Tue Sep 03 13:25:34
IBM sell signal. Add IBM Sep$75 Puts (IBM UO)


# END OF SAMPLE EMAIL MESSAGE
# ===============================
what is the best way to obtain just the body of the email message?

TIA
--
Mike<mickalo>Blezien
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Thunder Rain Internet Publishing
Providing Internet Solutions that work!
http://www.thunder-rain.com
Tel: 1(985)902-8484
MSN: [EMAIL PROTECTED]
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to