im using this code for my form
form action=“mail.php” method=“post”
input type=“text” class=“form-control” name=“subject” placeholder=“Subject”/
input type=“text” class=“form-control” name=“name” placeholder=“Full Name”/
input type=“text” class=“form-control” name=“email” placeholder="[email protected]"/
input type=“text” class=“form-control” name=“phone” placeholder=“your number”/
textarea rows=“6” class=“form-control” name=“message” placeholder=“Whats on your mind?” /textarea
button type=“submit” class=“btn btn-primary” name=“submit” Send Message /button
form
and this on my php
<?php $to = "[email protected]"; $subject = "Solicitud de Informacion Sobre ".$_POST['subject']; $name_field = $_POST['name']; $phone_field = $_POST['phone']; $email_field = $_POST['email']; $message = $_POST['message']; $headers = 'From: '.$_POST['email'].'' . "\\r\ " . 'Reply-To: '.$_POST['email'].'' . "\\r\ " . 'X-Mailer: PHP/' . phpversion(); $body = "Informacion del Contacto.\ \ " . "Nombre: " . $_POST['name'] . "\ " . "Correo: " . $_POST['email'] . "\ " . "Telefono: " . $_POST['phone'] . "\ " . "Mensaje: " . $_POST['message']; mail($to, $subject, $body, $headers ); header( 'Location:index.php' ) ; //replace with landing page. ?>i tested on other hosting and it works but i dont know it doesnt work here
i know that this are missing <> i just erased them to write the code here