Can any one help me set up my send mail php script to do what I need it to do? In the form I added 2 more fields called company and phone. As the script is written right now only the name, email and message will show up in the submitted email. I have tried to add the 2 new fields in many ways, but I get an error. Just not doing it right because I am not php savvy. What I want to see in the submitted email is this order:
Name:
Company:
Email:
Phone:
Message:
(the form is in a flash file so can't show you that, but it does work with the php as shown below, just not how I want it to)
***************************
PHP Code:
<?
//Send Mail PHP
//
//Upload this file to the root of your web directory
if(!empty($HTTP_POST_VARS['sender_mail']) || !empty($HTTP_POST_VARS['sender_message']) || !empty($HTTP_POST_VARS['sender_name']))
{
//Insert Address(s) to send the mail to
$to = "dianadolce@gmail.com";
//Subject
$subject = "Message from Amadeus Brochure Form";
//Body
$body = stripslashes($HTTP_POST_VARS['sender_message']);
$body .= "\n---------------------------\n";
$body .= "Mail sent by: " . $HTTP_POST_VARS['sender_name'] . " <" . $HTTP_POST_VARS['sender_mail'] . ">\n";
$body .= "\n\n";
$body .= "\nservice powered by dhsartstudio.com\n";
$header = "From: " . $HTTP_POST_VARS['sender_name'] . " <" . $HTTP_POST_VARS['sender_mail'] . ">\n";
$header .= "Reply-To: " . $HTTP_POST_VARS['sender_name'] . " <" . $HTTP_POST_VARS['sender_mail'] . ">\n";
$header .= "X-Mailer: PHP/" . phpversion() . "\n";
$header .= "X-Priority: 1";
//Mail Sentinel
if(@mail($to, $subject, $body, $header))
{
//Return Mail Status to Flash Form
echo "output=sent";
} else {
echo "output=error";
}
} else {
echo "output=error";
}
?>
***********************
Thank you, thank you for looking at this and helping me understand what has to happen.
Diana
Edit: Wrapped the code in [php][/php] tags
Bookmarks