I've created a mail message to be sent based on a select statement within a while argument. The problem I'm having is when I add additional fields. The mail message sends just fine with the following concatenation and coding:
while ($row = mysql_fetch_assoc($result))
{
$to = "abstrand@yahoo.com";
$subject = "New Potential Client";
$message = 'New Contact Information:'.'
'.$row["FIRST"].' '.$row["LAST"].'
'.$row["AGE"].' '.$row["GENDER"].'
'.$row["EMAIL"].'
'.'Cell '.$row["CELL"].' '.'Home '.$row["HOME"].'
'.$row["CITY"].'
'.$row["LOCATION"].' '.$row["TIMEBLOCK"].'
'.$row["PREFCTCT"].'
'.$row["COMMENT"];
if (mail($to, $subject, $message)) {
echo("<p>Message successfully sent! \r </p>");
} else {
echo("<p>Message delivery failed... \r </p>");
}
}
However, once I add a few more fields, the whole thing falls apart:
while ($row = mysql_fetch_assoc($result))
{
$to = "abstrand@yahoo.com";
$subject = "New Potential Client";
$message = 'New Contact Information:'.'
'.$row["FIRST"].' '.$row["LAST"].'
'.$row["AGE"].' '.$row["GENDER"].'
'.$row["EMAIL"].'
'.'Cell '.$row["CELL"].' '.'Home '.$row["HOME"].'
'.$row["CITY"].'
'.$row["LOCATION"].' '.$row["TIMEBLOCK"].'
'.$row["PREFCTCT"].'
'.'Fitness Goals: '.'
'.'Lose weight: '.'$row["LOSE"].'
'.'Gain muscle: '.'$row["GAIN"].'
'.'Lean and tone: '.'$row["LEAN"].'
'.'Injury Rehabilitation: '.'$row["REHAB"].'
'.'Sports specific training: '.'$row["SPORTS"].'
'.'Overall fitness: '.'$row["OVERALL"].'
'.$row["COMMENT"];
if (mail($to, $subject, $message)) {
echo("<p>Message successfully sent! \r </p>");
} else {
echo("<p>Message delivery failed... \r </p>");
}
}
Any thoughts on why an additional field blows the whole thing up? Is there a limit? I've even tried just putting in a simple extra echo field with 'hi' and it dies.
Thanks in advance.