I'm working on a PHP script, and the info from the form shows up in the headers of the email that I receive, but it doesn't show up in the body of the email. Can you please help me figure out what I'm doing wrong?
Here is the script:
[code=php]
<? function send_mail($emai laddress, $fromaddress, $emailsubject, $body)
{
$eol="\r\n";
$mime_boundary= md5(time());
# Common Headers
$headers .= 'From: Sending Love<'.$fromadd ress.'>'.$eol;
$headers .= 'Reply-To: Sending Love<'.$fromadd ress.'>'.$eol;
$headers .= 'Return-Path: Sending Love<'.$fromadd ress.'>'.$eol; // these two to set reply address
$headers .= "Message-ID: <".$now." TheSystem[color=black]@[/color]".$_SERVER['SERVER_NAME'].">".$eol;
$headers .= "X-Mailer: PHP v".phpversion() .$eol; // These two to help avoid spam-filters
# Boundry for marking the split & Multitype Headers
$headers .= 'MIME-Version: 1.0'.$eol;
$headers .= "Content-Type: multipart/related; boundary=\"".$m ime_boundary."\ "".$eol;
$msg = "";
# Setup for text OR html
$msg .= "Content-Type: text".$eol;
# Text Version
$msg .= "--".$mime_boundar y.$eol;
$msg .= "Content-Type: text/plain; charset=iso-8859-1".$eol;
$msg .= "Content-Transfer-Encoding: 8bit".$eol;
$msg .= strip_tags(str_ replace("<br>", "\n", $body)).$eol.$e ol;
# HTML Version
$msg .= "--".$mime_boundar y.$eol;
$msg .= "Content-Type: text/html; charset=iso-8859-1".$eol;
$msg .= "Content-Transfer-Encoding: 8bit".$eol;
$msg .= $body.$eol.$eol ;
# Finished
$msg .= "--".$mime_boundar y."--".$eol.$eol ; // finish with two eol's for better security. see Injection.
# SEND THE EMAIL
ini_set(sendmai l_from,$fromadd ress); // the INI lines are to force the From Address to be used !
mail($emailaddr ess, $emailsubject, $msg, $headers);
ini_restore(sen dmail_from);
#echo "mail send";
}
# To Email Address
$emailaddress=" denise@REMOVED. net";
# From Email Address
$fromaddress = "orders@REMOVED .ca";
# Message Subject
$emailsubject=" Web Customer Submission";
#----------------------------------------------------------------
# Message Body
$body = $body."This is a request for service from a customer <br>";
$body = $body."<b>Custo mer Name: </b>".$_REQUEST['cust_name']."<br>";
$body = $body."<b>Addre ss: </b>".$_REQUEST['cust_address']."<br>";
$body = $body."<b>City: </b>".$_REQUEST['cust_city']."<br>";
$body = $body."<b>Provi nce/State: </b>".$_REQUEST['cust_provstate ']."<br>";
$body = $body."<b>Zip: </b>".$_REQUEST['cust_postzip']."<br>";
$body = $body."<b>Count ry: </b>".$_REQUEST['cust_country']."<br>";
$body = $body."<b>E-Mail: </b>".$_REQUEST['cust_email']."<br>";
$body = $body."<b>Custo mer is Intersted in: </b>".$_REQUEST['cust_interest']."<br>";
$body = $body."<b>Other Specification: </b>".$_REQUEST['cust_interest_ other']."<br>";
$body = $body."<b>Desig n Selection: </b>".$_REQUEST['design_select']."<br>";
$body = $body."<b>Color Preferences: </b>".$_REQUEST['color_pref']."<br>";
$body = $body."<b>Custo mer Pertinent Info: </b>".$_REQUEST['cust_pertinfo']."<br>";
$body = $body."<b>Anyth ing else the customer would like to see: </b>".$_REQUEST['cust_ideas']."<br>";
$body = $body."<b>Thing s the customer doesn't want on their card: </b>".$_REQUEST['Cust_dont_want ']."<br>";
$body = $body."<b>Card Size: </b>".$_REQUEST['card_size']."<br>";
$body = $body."<b>Card Finish: </b>".$_REQUEST['card_finish']."<br>";
$body = $body."<b>Quant ity: </b>".$_REQUEST['quantity']."<br>";
$body = $body."<b>Can you use the finished product as a design example? : </b>".$_REQUEST['cust_permissio n']."<br>";
$body = $body."<b>How did you find us?: </b>".$_REQUEST['found_us']."<br>";
#Add all other parts here
#----------------------------------------------------------------
send_mail($emai laddress, $fromaddress, $emailsubject, $body);
?>
[/code]
TIA for your Help!
Here is the script:
[code=php]
<? function send_mail($emai laddress, $fromaddress, $emailsubject, $body)
{
$eol="\r\n";
$mime_boundary= md5(time());
# Common Headers
$headers .= 'From: Sending Love<'.$fromadd ress.'>'.$eol;
$headers .= 'Reply-To: Sending Love<'.$fromadd ress.'>'.$eol;
$headers .= 'Return-Path: Sending Love<'.$fromadd ress.'>'.$eol; // these two to set reply address
$headers .= "Message-ID: <".$now." TheSystem[color=black]@[/color]".$_SERVER['SERVER_NAME'].">".$eol;
$headers .= "X-Mailer: PHP v".phpversion() .$eol; // These two to help avoid spam-filters
# Boundry for marking the split & Multitype Headers
$headers .= 'MIME-Version: 1.0'.$eol;
$headers .= "Content-Type: multipart/related; boundary=\"".$m ime_boundary."\ "".$eol;
$msg = "";
# Setup for text OR html
$msg .= "Content-Type: text".$eol;
# Text Version
$msg .= "--".$mime_boundar y.$eol;
$msg .= "Content-Type: text/plain; charset=iso-8859-1".$eol;
$msg .= "Content-Transfer-Encoding: 8bit".$eol;
$msg .= strip_tags(str_ replace("<br>", "\n", $body)).$eol.$e ol;
# HTML Version
$msg .= "--".$mime_boundar y.$eol;
$msg .= "Content-Type: text/html; charset=iso-8859-1".$eol;
$msg .= "Content-Transfer-Encoding: 8bit".$eol;
$msg .= $body.$eol.$eol ;
# Finished
$msg .= "--".$mime_boundar y."--".$eol.$eol ; // finish with two eol's for better security. see Injection.
# SEND THE EMAIL
ini_set(sendmai l_from,$fromadd ress); // the INI lines are to force the From Address to be used !
mail($emailaddr ess, $emailsubject, $msg, $headers);
ini_restore(sen dmail_from);
#echo "mail send";
}
# To Email Address
$emailaddress=" denise@REMOVED. net";
# From Email Address
$fromaddress = "orders@REMOVED .ca";
# Message Subject
$emailsubject=" Web Customer Submission";
#----------------------------------------------------------------
# Message Body
$body = $body."This is a request for service from a customer <br>";
$body = $body."<b>Custo mer Name: </b>".$_REQUEST['cust_name']."<br>";
$body = $body."<b>Addre ss: </b>".$_REQUEST['cust_address']."<br>";
$body = $body."<b>City: </b>".$_REQUEST['cust_city']."<br>";
$body = $body."<b>Provi nce/State: </b>".$_REQUEST['cust_provstate ']."<br>";
$body = $body."<b>Zip: </b>".$_REQUEST['cust_postzip']."<br>";
$body = $body."<b>Count ry: </b>".$_REQUEST['cust_country']."<br>";
$body = $body."<b>E-Mail: </b>".$_REQUEST['cust_email']."<br>";
$body = $body."<b>Custo mer is Intersted in: </b>".$_REQUEST['cust_interest']."<br>";
$body = $body."<b>Other Specification: </b>".$_REQUEST['cust_interest_ other']."<br>";
$body = $body."<b>Desig n Selection: </b>".$_REQUEST['design_select']."<br>";
$body = $body."<b>Color Preferences: </b>".$_REQUEST['color_pref']."<br>";
$body = $body."<b>Custo mer Pertinent Info: </b>".$_REQUEST['cust_pertinfo']."<br>";
$body = $body."<b>Anyth ing else the customer would like to see: </b>".$_REQUEST['cust_ideas']."<br>";
$body = $body."<b>Thing s the customer doesn't want on their card: </b>".$_REQUEST['Cust_dont_want ']."<br>";
$body = $body."<b>Card Size: </b>".$_REQUEST['card_size']."<br>";
$body = $body."<b>Card Finish: </b>".$_REQUEST['card_finish']."<br>";
$body = $body."<b>Quant ity: </b>".$_REQUEST['quantity']."<br>";
$body = $body."<b>Can you use the finished product as a design example? : </b>".$_REQUEST['cust_permissio n']."<br>";
$body = $body."<b>How did you find us?: </b>".$_REQUEST['found_us']."<br>";
#Add all other parts here
#----------------------------------------------------------------
send_mail($emai laddress, $fromaddress, $emailsubject, $body);
?>
[/code]
TIA for your Help!
Comment