Brother monks ... in all humbleness, I beg for assistance ...
I am trying to retrieve the individual components of an e-mail message and then re-write it (to a database or to another e-mail box). I am using Mail:Internet which retrieves the "To", "From" and "Subject" by using the
get() command. I tried this for the body ... didn't work. Turns out I have to use
body(); . Fine, easy enough. I assigned the values which
body() calls to a scalar ($body, for instance). Then I tried to
print MAIL '$body\n';
, but it didn't work. It turns out that
$body is some kind of an array b/c when I
print MAIL "$body[0]\n";
,
I get the first line of the body. I tried to save the output of
body() to
@body, but the program wouldn't run.
The problem is that I now I want to retrieve and print out a bunch of different e-mail bodies, all of different lengths. So I was going to run a for loop using
$#body as the last value to run the loop. But it turns out I can't use this value because (I'm suppossing) its a scalar (
$body).
Argghhhh! If I could just get the body contents as a scalar I could just print them out with
print "$body\n";
or even if I had it as an array I could run a for loop through the last value of the array and just print it out, but I can't define the last value with
$#body because it's not a "@"!! I could just run the for loop through a set value of 1000 lines, but how pretty is that? Not very.
If there is another way to retrieve the body of an e-mail as a usable variable (scalar or array) please let me know.
I beg forgiveness for any misused terminology ... I am still yet a neophyte to these waters.
cdherold
2001-04-06 Edit by Corion : Added CODE tags