Good, I'm trying to send data from a form to a gmail, but the mail () function always returns false from my PHP code, but Mercury does send it to me. I'm using XAMPP.
The Mercury is set up following this manual :
This is the form:
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<title>Correo</title>
</head>
<body>
<div>
<form action="envio.php" method="post">
<input type="text" name="nombre" placeholder="Nombre" />
<input type="email" name="email" placeholder="Email" />
<input type="text" name="Teléfono" placeholder="Telefono" />
<textarea type="text" name="mensaje" placeholder="Mensaje"></textarea>
<input type="submit" value="ENVIAR" id="boton" />
</form>
</div>
</body>
</html>
and this is the php file:
<?php
$destino="[email protected]";
$nombre=$_POST["nombre"];
$correo=$_POST["correo"];
$telefono=$_POST["telefono"];
$mensaje=$_POST["mensaje"];
$contenido="Nombre: " . $nombre . "\nCorreo: " . $correo . "\nTeléfono: " . $telefono . "\nmensaje" . $mensaje;
$exito=mail($destino, "Contacto", $contenido);
if($exito){
echo("Bien");
}else{
echo("Mal");
}
?>