mi html:
Código HTML:
<form action="send.php" method="post" enctype="text/plain"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td>Name:</td> <td rowspan="8" width="5%"> </td> <td>Message:</td> </tr> <tr> <td valign="top"> <input name="name_form" type="text" class="form"/> </td> <td rowspan="5" valign="top"><textarea name="message_form" cols="40" rows="8" class="form"></textarea></td> </tr> <tr> <td>Country:</td> </tr> <tr> <td valign="top"><input name="country_form" type="text" class="form"/></td> </tr> <tr> <td>Phone:</td> </tr> <tr> <td valign="top"><input name="phone_form" type="text" class="form"/></td> </tr> <tr> <td>Mail:</td> <td valign="top"> </td> </tr> <tr> <td valign="top"><input name="mail_form" type="text" class="form" /></td> <td> <input name="reset" type="reset" class="button" value="Reset" /> <input name="submit" type="submit" class="button" value="Submit" /> </td> </tr> </table> </form>
Código:
el script lo había levantado de internet hace un tiempo ya y lo pude utilizar en varios sitios exitosamente... no termino de entender qué estoy pasando por alto.<?php
$name = $_POST['name_form'];
$country = $_POST['country_form'];
$phone = $_POST['phone_form'];
$mail = $_POST['mail_form'];
$message = $_POST['message_form'];
$header = 'From: ' . $mail . " \r\n";
$header .= "X-Mailer: PHP/" . phpversion() . " \r\n";
$header .= "Mime-Version: 1.0 \r\n";
$header .= "Content-Type: text/plain";
$mensaje = "Sent by " . $name . ", from " . $country . " \r\n";
$mensaje .= "Email: " . $mail . " \r\n";
$mensaje .= "Phone: " . $phone . " \r\n";
$mensaje .= "Mensaje: " . $message . " \r\n";
$mensaje .= "Enviado el" . date('d/m/Y', time());
$para = '[email protected]';
$asunto = 'Contacto desde WEB';
if (mail($para, $asunto, utf8_decode($mensaje), $header)) {
echo("<p>Message successfully sent!</p>");
} else {
echo("<p>Message delivery failed...</p>");}
?>
gracias!




