problem using email - should of posted it here instead

the mail() function

Moderators: egami, macek, gesf

Post Reply
jesso3
New php-forum User
New php-forum User
Posts: 8
Joined: Mon Feb 17, 2003 4:53 pm

Fri Mar 14, 2003 10:00 am

Hi. I am having this problem using the email function. I get a cookie and use the value of it to get an array like below: The problem is that when I email the variable, only the last line of the array is sent, not the whole thing. But, everything gets printed on the screen like it should. Can someone help me here?
for ($y = 0; $y < 15; $y++) {
$realy=$y+1;
$tempAns= $answers[y];
$tempCorrect= $CorrectAns[y];
//if (strtolower($tempAns)==strtolower($tempCorrect)) {

echo "$speechst Question $realy - Correct.";
//}
//else {
echo "$speechst Question $realy - Incorrect. Actual Answer was :$Explanation[y]";
$ans = "$speechst Question $realy - Incorrect. Actual Answer was :$Explanation[y]";
$body = "$email, $name, $Company, $City, $phone_no, $currentgrade, $currentScore, $ans";
//}
}
//$body = "$email, $name, $Company, $City, $phone_no, $currentgrade, $currentScore, $ans";
$hdr = "From: Infotrends Canada\r\n";
$hdr .= "Return-Path: $derek@infotrendscanada.com\r\n";
if($cc){$hdr .= "Cc: $cc\r\n";}
if($bcc){$hdr .= "Bcc: $bcc\r\n";}
for($i = 0; $i < $sizeof; $i++){
if(mail($to[$i], $subject, $body, $hdr))
{
$status = "Your message was successfully sent.";
}
else
{
$status = "An error occurred while sending your message.";
}
}

jesso3
New php-forum User
New php-forum User
Posts: 8
Joined: Mon Feb 17, 2003 4:53 pm

Mon Mar 17, 2003 2:18 pm

Since no one replied to my posting as of yet, I am assuming my problem is unsolvable. Thanks anyway.

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests