PHP mail form not work


#1

Best Regards:

My website was made in Swismax (SWF) who´s call a simple PHP script that work perfecly on php 4 servers but not work on your server:

<?php /* ########################################################## ## SWiSHmax Contact Form was created by Brian Ayers of Swish-Tutorials.com ## ## Unless a Donation is made for these form files - this copyright should remain intact #### Please Link directly to the main site - www.swish-tutorials.com## ## ## ## To Customize this Form -- Please Read the Comments I've Added ! ## ## Be SURE to rename this file to: st_mailform_script.php if you use it ## ########################################################## */ // IMPORTANT NOTE: DO NOT change anything that has a $ before it // Any line that has two slashes in front of it is a comment (and will be ignored by this script) /* // In case register globals is off (backwards compatibility) // If you add additional input text fields - you need to add them here as well // for example, if you add a text field with a variable "Phone", add: // $phone = $HTTP_POST_VARS['Phone']; // Remember -- you would then also need to add them in the 'Remove Slashes' section // as $phone (for example), and somewhere in the 'msg_body' below // I have added this example in to the script below to help give you a guide */ $message = $_POST['Message']; $name = $_POST['Name']; $email = $_POST['Mail']; $phone = $_POST['phone']; // Begin Censors $message = eregi_replace('coño', "flip", $message); $message = eregi_replace('mierda', "crap", $message); $message = eregi_replace('marico', "nice lady", $message); $message = eregi_replace('sucios', "butt", $message); $message = eregi_replace('putas', "pee", $message); // End Censors // Remove Slashes Inserted by PHP $name = stripslashes($name); $email = stripslashes($email); $message = stripslashes($message); $phone = stripslashes($phone); // Start Customizable Email Information // Change the information in quotes below to fit your needs $rec_email = "hazanow@studioh.com.ve"; // who do you want to send this email to $subject = "PMA_Web V"; // this is the subject line of the email // End Customizable Email Information // The Body of the Email message // You can customize the email you receive by changing the text inside the quotes below // The code "\n" (without quotes) will add a new line in the email body // Don't forget to add extra '$msg_body .=' // for each additional input field you have added to your form // IMPORTANT NOTE: DO NOT change anything that has a $ before it $msg_body = "Mensaje desde $SERVER_NAME\n"; $msg_body .= "==========================================\n"; $msg_body .= "Nombre: $name\n"; $msg_body .= "E-Mail: $email\n"; $msg_body .= "Comentarios: $message\n"; $msg_body .= "Teléfono: $phone\n"; $msg_body .= "==========================================\n"; $msg_body .= "\n\n"; $msg_body .= "Información adicional del remitente\n"; $msg_body .= "==========================================\n"; $msg_body .= "IP Dirección: $REMOTE_ADDR\n"; $HostName = gethostbyaddr($_SERVER['REMOTE_ADDR']); $msg_body .= "Host: $HostName\n"; $msg_body .= "Navegadores: $HTTP_USER_AGENT\n"; $msg_body .= "==========================================\n"; $msg_body .= "Formato PHP mail provisto por http://www.studioh.com.ve"; // Add Some Extra Header Information to the Mail $header_info = "From: ".$name." <".$email.">"; // Now let's take the information above and mail it to the recipient mail($rec_email, $subject, $msg_body, $header_info); /* ########################################################## ## SWiSHmax Contact Form was created by Brian Ayers of Swish-Tutorials.com ## ## Unless a Donation is made for these form files - this copyright should remain intact ## ## Please Link directly to the main site - www.swish-tutorials.com ## ########################################################## */ ?>

I changed the http comand´s for $_post but the e-mail incoming looks like this:

Mensaje desde

Nombre: studio H
E-Mail: [color=#FF4500]EMPTY[/color]
Comentarios: [color=#FF4500]EMPTY[/color]
Teléfono: 56565656

Información adicional del remitente

IP Dirección:
Host: 200.109.29-176.dyn.dsl.cantv.net
Navegadores:

Formato PHP mail provisto por http://www.studioh.com.ve


#2

Are you certain the POST field is called “Email” and not (for instance) “email”? Case matters. Same thing goes for “Message”.

To fix up the “Ip Dirección” and “Navegadores”, you’ll want to add:
[php]
$REMOTE_ADDR = $_SERVER[“REMOTE_ADDR”];
$HTTP_USER_AGENT = $_SERVER[“HTTP_USER_AGENT”];
[/php]