
fred - 2005-10-18 18:20:45
Hi,
I am quite new to php, however i am wondering if anyone can help me out with the $body array...
In the same script that i use to call the pop3.php file, i wish to automatically download an email, attach a file and forward it to a different recipient.
To download the email this script works fine and is able to be displayed with no problems.
For attaching a file and sending to a recipient i have no problems, i am using phpMailer, this works fine.
However I am having a problem merging the incoming mail, with the outgoing mail. The download part works, and the send email with appropriate attachement works. However the issue i am having surrounds getting the data out of the array... here is the details
for($line=0;$line<count($body);$line++)
echo "<PRE>",HtmlSpecialChars($body[$line]),"</PRE>\n";
These 2 lines display the email on a page in the correct format.
I them want to take the body (which is about 15lines long (size varies!)) and insert it into another email...
I currently have this which doesn't work...
$mail->Body = "hello";
for($line=0;$line<count($body);$line++){
$mail->Body .= "".$body[$line]."\n";
}
I have tried using this... which makes the formatting come out incorrectly...
$body1=implode("\n", $body);
$mail->Body = $body1;
Any pointers that anyone has in helping me get the data out of the array called $body would be very much appreciated.
Thanks
Freddy