Message body

A

Antony

Hi,

I am trying to read an email into an array, using the POP method. However I
can read each of the lines using if($line =~ m/Subject: /) { (as the subject
for example), but how do I read the main email content/topic/body into an
array, as it doesnt appear to have a header title.

thanks

Antony
(This email has been checked
by Norton Antivirus 2004)
www.cdtoday.co.uk
 
A

A. Sinan Unur

I am trying to read an email into an array, using the POP method.
However I can read each of the lines using if($line =~ m/Subject: /) {
(as the subject for example), but how do I read the main email
content/topic/body into an array, as it doesnt appear to have a header
title.

CPAN is your friend. You can use Mail::pOP3Client. Specifically, the Body
method is what you are looking for. You can find the module at:

http://search.cpan.org/~sdowd/Mail-POP3Client-2.16/

Shamless plug: I have grown quite fond of Mail::pOP3Client. There is a
short script that I find useful (and illustrates the use of the module) at

<http://www.unur.com/comp/delspam_pl.txt>.

Sinan.
 
A

Antony

Hi

Thanks for your reply. I was however hoping to use Net::pOP3 module as the
basis, because the script is already formatted for this. Does the POP3Client
need any different scripting?

Antony
 
S

Sherm Pendley

(Upside-down quoting rearranged - please don't do that.)
Thanks for your reply. I was however hoping to use Net::pOP3 module as the
basis, because the script is already formatted for this. Does the
POP3Client need any different scripting?

Didn't you look at the example A. Sinan gave you?

Obviously, POP3Client is different, but using it should be just a simple
matter of a changing a few method calls. It's not like you'd have to start
over, and rewrite your whole script in FORTRAN or something. ;-)

sherm--
 
A

A. Sinan Unur

[ Top-posting fixed. Please don't do that. ]
....

Thanks for your reply. I was however hoping to use Net::pOP3 module as
the basis, because the script is already formatted for this. Does the
POP3Client need any different scripting?

The reason I mentioned Mail::pOP3Client is because you did not
originally mention any modules.

You can find out the differences in the two modules by reading their
documentation. I do not know what you are trying to do, so it is hard
for me to recommend ditching Net::pOP3.

At this point, you might want to read the posting guidelines for this
group to see how you can help others help you.

Sinan.
 
G

Gunnar Hjalmarsson

[ Please do not top post! ]
Thanks for your reply. I was however hoping to use Net::pOP3 module as the
basis, because the script is already formatted for this.

That would work fine as well.

Post the code you have tried so far (or rather a short but runnable code
fragment that illustrates what you tried), and somebody may be able to
help you fix it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,608
Members
45,249
Latest member
KattieCort

Latest Threads

Top