I would like to know if there is any way to get mail sent from a form to an email from my company.
I tried with my gmail mail and it works correctly. But I send from another email and they do not arrive ...
My form:
<form method="post" action="php/enviarmails/enviarContactos.php" >
<div class="fields">
<div class="field half" >
<label for="nombre" >Nombre</label>
<input type="text" name="nombre" id="nombre" />
</div>
<div class="field half">
<label for="email" >Correo Electronico</label>
<input type="text" name="email" id="email" />
</div>
<div class="field half">
<label for="celular" >Celular</label>
<input type="text" name="celular" id="celular" />
</div>
<div class="field half">
<label for="empresa" style="color:#46A1BE">Empresa</label>
<input type="text" name="empresa" id="empresa" />
</div>
<div class="field">
<label for="mensaje" style="color:#46A1BE">Escriba un mensaje</label>
<textarea name="mensaje" id="mensaje" rows="6" ></textarea>
</div>
</div>
<ul class="actions">
<li><input type="submit" value="Enviar Mensaje" class="primary" /></li>
<li><input type="reset" value="Limpiar" /></li>
</ul>
</form>
My php code:
<?php
$texto_mail=$_POST["mensaje"];
$nombre=$_POST["nombre"];
$email=$_POST["email"];
$celular=$_POST["celular"];
$empresa=$_POST["empresa"];
$destinatario="[email protected]";
$asunto="Escribieron en contactos CYGNUS";
$headers="MIME-Version: 1.0\r\n";
$headers.="Content-type: text/html; charset=iso-8859-1\r\n";
$headers.="From: Escribieron en la Pagina < [email protected] >\r\n";
$exito=mail($destinatario,$asunto,"Correo Electronico " . $email . "<br>" . "Nombre: " . $nombre . "<br>Celular: ". $celular . "<br> Empresa: " . $emrpesa . "<br> Comentario del mensaje: " . $texto_mail ,$headers);
if ($exito) {
header("location: ../../enviadoContactos.html");
} else {
echo "Ha ocurrido un error";
}
?>
The truth is that I do not know if it is my hosting or the mail server of the company the reason why they do not arrive.
If you have some experience about this, I would appreciate it.