Tengo un problema con esta planilla de contacto en php... no esta funcionando bien.... no esta enviando la informacion correctamente, no me aparecen todos los campos solamente los de text que va en donde dice comentario... ya me estoy volviendo loco y no se que es
Mi codigo sendmail.php
Código:
<?php $mailto = "[email protected];[email protected]"; $messagesubject = "Email enviado desde la web"; $author = $_POST['author']; $fromaddress = $_POST['email']; if(isset($_POST['telf'])){ $telf = $_POST['telf']; }else{$telf = "No coloco telefono";} if(isset($_POST['ciudad'])){ $ciudad = $_POST['ciudad']; }else{$ciudad = "No coloco ciudad";} $body = $_POST['text']; $message = $author." envio un email:\r\n Mensaje: " $email."\r\nTelefono: " $telf."\r\nCiudad: " $ciudad."\r\n\n\nMessage:\r\n<----BEGINNING OF MESSAGE!---->\r\n" $body."\r\n\n<----END OF MESSAGE!---->\r\n"; $eol = "\r\n"; $mime_boundary=md5(time()); $headers .= 'From: '.$author.' .<'.$fromaddress.'>'.$eol; $headers .= 'Reply-To: '.$author.' .<'.$fromaddress.'>'.$eol; $headers .= 'Return-Path: '.$author.' .<'.$fromaddress.'>'.$eol; $headers .= "Message-ID: <".time()." TheSystem@".$_SERVER['SERVER_NAME'].">".$eol; $headers .= "X-Mailer: PHP v".phpversion().$eol; $headers .= 'MIME-Version: 1.0'.$eol; $headers .= "Content-Type: multipart/related; boundary=\"".$mime_boundary."\"".$eol; $msg .= "Content-Type: multipart/alternative".$eol; $msg .= "--".$mime_boundary.$eol; $msg .= "Content-Type: text/plain; charset=iso-8859-1".$eol; $msg .= "Content-Transfer-Encoding: 8bit".$eol; $msg .= strip_tags(str_replace("<br>", "\n", $message)).$eol.$eol; $msg .= "--".$mime_boundary.$eol; $msg .= "Content-Type: text/html; charset=iso-8859-1".$eol; $msg .= "Content-Transfer-Encoding: 8bit".$eol; $msg .= str_replace("\n", "<br>", $message).$eol.$eol; $msg .= "--".$mime_boundary."--".$eol.$eol; ini_set(sendmail_from, $fromaddress); // the INI lines are to force the From Address to be used ! $formsent = mail($mailto, $messagesubject, $msg, $headers); ini_restore(sendmail_from); if ($formsent) { echo "<fieldset style='background-color:#FFFFCC;'><legend>¡Gracias! ".$author."</legend><p>ya recibimos tu email, te contestaremos a la brevedad posible.</p></fieldset>"; }else{ echo "Hubo un problema con la planilla de contact, intenta de nuevo"; } ?>
Mi codigo html:
Código:
<form method="post" name="contact" id="contact_form" class="leyenda" action="sendmail.php"> <div class="clear"><h2>Formulario de contacto</h2><br/></div> <input type="hidden" name="post" value=" Send " /> <div class="float"> <label for="author">* Nombre:</label><br/> <input type="text" id="author" name="author" class="required" /> </div> <div class="float" style="clear:right"> <label for="email">* Correo electronico:</label><br/> <input type="text" id="email" name="email" class="required email" /> </div> <div class="float"> <label for="telf">Telefono de contacto:</label><br/> <input type="text" name="digits" id="telf" class="digits" /> </div> <div class="float"> <label for="ciudad">Ciudad / Localidad</label><br/> <input type="text" name="ciudad" id="ciudad" /><br/><br/> </div> <div style="clear:both"> <label for="text">* Comentario:</label><br /> <textarea id="text" name="text" rows="6" cols="42" class="required"></textarea><br /><br /> <input type="submit" name="submitbutton" id="submitbutton" value=" Enviar " /> <div id="progress" style="display:none;">Enviando...</div> </div> </form>
Saludos y gracias por su ayuda!