elunicotomas Posted March 25, 2013 Share Posted March 25, 2013 (edited) Hi there! I'm new to the forum and I have little knowledge of PHP but I managed to make a contact form. I've looked at the other threads about PHP Contact Form and tried different options but nothing seems to work, so here is my code. I can't make the Reply-To to have the sumbitter email. In reply-to I get: [email protected] (wiroos is the hosting company name), everything else is working fine. Any ideas? Thanks! The form: <form action="procesar_form.php" method="post" name="formulario" id="formulario" onsubmit='return validarFormulario()'> <label for="nombre">Nombre </label> <input type="text" name="nombre" id="nombre" size="60"/> <label for="apellido">Apellido </label> <input type="text" name="apellido" id="apellido" size="60"/> <label for="email">Email </label> <input type="text" name="email" id="email" size="60"/> <label for="comentarios">Comentarios</label> <textarea name="comentarios" id="comentarios" cols="44" rows="10"></textarea> <input type="button" name="enviar" id="enviar" value="Enviar" onclick="validarFormulario()" /></textarea> </form> PHP code: $email = $_POST['email']; $to = '[email protected]'; $subject = 'Contacto PowerFitness'; $message = 'Nombre: ' . $_POST['nombre'] . "\n" . 'Apellido: ' . $_POST['apellido'] . "\n" . 'Email: ' . $_POST['email'] . "\n" . 'Comentarios: ' . $_POST['comentarios']; $headers = 'From: $email' . "\n" . 'Reply-to: $email' . "\n" . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); header("Location: ../../index.html"); And I sent an email to my address (from the form) so you can see the email source and here it is: > Delivered-To: [email protected] Received: by 10.60.132.7 with > SMTP id oq7csp23527oeb; > Sun, 24 Mar 2013 17:57:27 -0700 (PDT) X-Received: by 10.236.160.195 with SMTP id u43mr5762986yhk.104.1364173047442; > Sun, 24 Mar 2013 17:57:27 -0700 (PDT) Return-Path: <[email protected]> Received: from hn02.wiroos.com > (hn02.wiroos.com. [199.115.114.195]) > by mx.google.com with ESMTPS id h65si7425664yhk.272.2013.03.24.17.57.27 > (version=TLSv1 cipher=RC4-SHA bits=128/128); > Sun, 24 Mar 2013 17:57:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of [email protected] > designates 199.115.114.195 as permitted sender) > client-ip=199.115.114.195; Authentication-Results: mx.google.com; > spf=pass (google.com: best guess record for domain of [email protected] designates 199.115.114.195 as permitted sender) > [email protected] Received: from nobody by > hn02.wiroos.com with local (Exim 4.80) (envelope-from > <[email protected]>) id 1UJvj2-0002cx-SK for > [email protected]; Sun, 24 Mar 2013 21:57:25 -0300 To: > [email protected] Subject: Contacto PowerFitness X-PHP-Script: > powerfitness.com.ar/contacto/procesar_form.php for 200.70.31.20 From: > Contacto PowerFitness [email protected] Reply-To: > [email protected] X-Mailer: PHP/5.3.21 Message-Id: > <[email protected]> Date: Sun, 24 Mar 2013 21:57:24 > -0300 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - > hn02.wiroos.com X-AntiAbuse: Original Domain - gmail.com X-AntiAbuse: > Originator/Caller UID/GID - [99 32007] / [47 12] X-AntiAbuse: Sender > Address Domain - hn02.wiroos.com X-Get-Message-Sender-Via: > hn02.wiroos.com: uid via acl_c_vhost_owner from authenticated_id: > nobody from /only user confirmed/virtual account not confirmed > X-Source: X-Source-Args: /usr/local/apache/bin/httpd -k start -DSSL > X-Source-Dir: powerfitness.com.ar:/public_html/contacto > > Nombre: Tomas Apellido: Perez Ponisio Email: [email protected] > Comentarios: 132465 Edited March 25, 2013 by elunicotomas Quote Link to comment https://forums.phpfreaks.com/topic/276106-php-contact-form-reply-to/ Share on other sites More sharing options...
Solution haku Posted March 25, 2013 Solution Share Posted March 25, 2013 $headers = "From: $email" . "\n" . "Reply-to: $email" . "\n" . 'X-Mailer: PHP/' . phpversion(); Quote Link to comment https://forums.phpfreaks.com/topic/276106-php-contact-form-reply-to/#findComment-1420832 Share on other sites More sharing options...
elunicotomas Posted March 25, 2013 Author Share Posted March 25, 2013 $headers = "From: $email" . "\n" . "Reply-to: $email" . "\n" . 'X-Mailer: PHP/' . phpversion(); Many Thanks!!!!! Quote Link to comment https://forums.phpfreaks.com/topic/276106-php-contact-form-reply-to/#findComment-1420834 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.