Error in form to send messages to email

0

Hello friends, I have the following code (note add PHP to html5 so they could see all the code, I do not have it that way), well, I have it and it worked properly for me and I got the emails well, but since I there was an error of GMAIL authentication, it does not work anymore, but I have solved GMAIL, where I have my code wrong?

I do not understand if it works properly for me before, I do not use LAMPP in Ubuntu / Desktop version version 16.4 ..

My code is this:

<!DOCTYPE html>
<html>
<head>
<title>Ejemplo</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.0/jquery.min.js"></script>

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">

<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.js"></script>

</head>
<style type="text/css">

body{
    padding:0;
    margin:0;
background-image:url("img/fondo.JPG");

}
  .alineacion{
  float: right;
}
</style>
<body>
</body>
</html>
<nav  class="navbar navbar-inverse">
  <div class="container-fluid">
<div class="navbar-header">
  <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
    <span class="icon-bar"></span>
    <span class="icon-bar"></span>
    <span class="icon-bar"></span>                        
  </button>
  <a class="navbar-brand" href="#">Rosa susana</a>
</div>
<div class="collapse navbar-collapse" id="myNavbar">
  <ul class="alineacion nav navbar-nav">
    <li class="active"><a href="inicio.html">Ver los caballos</a></li>

 </ul>
</div>
  </div>
</nav>  
<?php
$action=$_REQUEST['action'];
if ($action=="")    /* display the contact form */
{
?>
   <img class="avatar" src="Logo para web.svg" width="200px" height="200px">

<div class="col-md-6"></div> <!-- Columna vacía -->
<div class="col-md-12"><!-- Columna derecha con formulario -->
<form  style=" float:right;padding:10px;margin:10px;right:10px;margin-bottom:100px;" action="" method="POST" enctype="multipart/form-data">
   <p style="color:white;">Tu nombre:</p>
<input placeholder="Nombre" required=""  name="name" type="text" value="" size="30"/><br>
<p style="color:white;">Tu email:</p>
<input placeholder="E-mail" required="" name="email" type="text" value="" size="30"/><br>
<p style="color:white;">Tu Direcion:</p>
<textarea placeholder="Direcion" required="" name="message" rows="7" cols="30"></textarea><br><br><br>
<input class="btn btn-default" type="submit" value="Enviar mensaje"/>
<br>
<a href="chat-Messenger/J2TeaM-Facebook-Live-Chat-9231c6e/example.html">Si no se envian los mensajes comunicate por Atencion a Cliente.</a>
</form>
</div>
<?php
} 
else                /* send the submitted data */
{
$name=$_REQUEST['name'];
$email=$_REQUEST['email'];
$message=$_REQUEST['message'];
if (($name=="")||($email=="")||($message==""))
    {
	echo "All fields are required, please fill <a href=\"\">the form</a> again.";
    }
else{		
    $from="From: $name<$email>\r\nReturn-path: $email";
    $subject="CONTACTO CABALLO :)";
	 mail("[email protected]", $subject, $message,$from);
	echo "Su Mensaje fue enviado con exito a nosotros!";
    echo "<a href='mail.php'></a>";
    }
}  
?>
<div style="color:white;font-family:arial; background:transparent;width:50%;padding-left:30px;" class="">
<p>Contacto:blablablablabla.</p>
<p>Correo: [email protected]</p>
</div>

Where it says "[email protected]" there I put my email where the messages would arrive.

    
asked by simon 06.05.2017 в 06:18
source

0 answers