0

Can anyone help me find out why this isn´t working? I don´t understand much, actually i never worked with php, but i need to make this work as soon as posible..

here´s the html

<div class="form-style-6">
        <h1>Dejenos su consulta! </h1>
        <form action= "contacto.php" method="post">
            <input type="text" name="field1" placeholder="Nombre" />
            <input type="email" name="field2" placeholder="E-mail"/>
            <input type="subject" name="field4" placeholder="Asunto"/>
            <textarea name="field3" placeholder="Mensaje"></textarea>

            <input type="submit" value="ENVIAR"/>
        </form>
    </div>

and here´s the .php

<html><body>
<?php

$field1= $_POST['field1'];
$fied2= $_POST['field2'];
$field4= $_POST['field4'];
$field3= $_POST['field3'];


$mailsend= mail ('airlog_gc@hotmail.com','CONSULTAS',"Nombre: $field1\r\nE-mail: $field2\r\nAsunto: $field4\r\nMensaje: $field3");

if ($mailsend) {echo"<p>Gracias por su consulta. Le responderemos a la brevedad</p>";}

else

{echo "Ha ocurrido un error en el envío. Vuelva a intentarlo más tarde. Disculpe las molestias";}





?>

</body>
</html>

Thanks a lot. I hope Someone helps. Cheers

  • 3
    What is the problem?Your form is not submitted or email is not working or any error you are getting.. Be precise.. – learner Aug 27 '15 at 22:23
  • Please read [this](http://stackoverflow.com/help/how-to-ask), and edit your question with more precis information. "Not working" does not tell us anything. – Anders Aug 27 '15 at 22:26
  • You should also check if your variables $_POST ['var'] exist using `isset()` – Lauromine Aug 27 '15 at 22:28
  • yes, sorry. I never get the mails, I press send button and it shows me the echo for "thanks, we recieved the message", but i never get the mails. –  Aug 27 '15 at 22:28
  • 1
    @Gloria_GC so, please edit the question and add these lines there.. – learner Aug 27 '15 at 22:29
  • Possible duplicate: http://stackoverflow.com/questions/24644436/php-mail-form-doesnt-complete-sending-e-mail – Anders Aug 27 '15 at 22:34
  • Possibly you are using some email providers that has a spam filter? E.g. gmail – JCCM Aug 28 '15 at 00:35

1 Answers1

1

You have a typo in

$fied2= $_POST['field2'];

I think you meant to write

$field2= $_POST['field2'];
PsykoGert
  • 48
  • 4