Quantcast
Channel: Tópicos
Viewing all articles
Browse latest Browse all 14700

Envio de email

$
0
0
Tenho um problema no envio de email, é que se for para o gmail envia sem problema e se for para o servidor de email do site não envia, quer dizer, não dá erros, envia sem problemas nas nunca recebo.
Alguem me pode ajudar?
Onde o dominio e o alojamento está é em AMEN.pt.

Código :
<?php
$msg="";
if(isset($_POST['submit']))
{
$from_add = "noreply@trvlr.pt";
$to_add = "info@trvlr.pt";
$subject = "Test Subject";
$message = "Hello world";

$headers = "From: $from_add \r\n";
$headers .= "Reply-To: $from_add \r\n";
$headers .= "Return-Path: $from_add\r\n";
$headers .= "X-Mailer: PHP \r\n";


if(mail($to_add,$subject,$message,$headers))
{
  $msg = "Mail sent OK";
}
else
{
         $msg = "Error sending email!";
}
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Test form to email</title>
</head>
<body>
<?php echo $msg ?>
<p>
<form action='<?php echo htmlentities($_SERVER['PHP_SELF']); ?>' method='post'>
<input type='submit' name='submit' value='Submit'>
</form>
</p>

</body>
</html>

Viewing all articles
Browse latest Browse all 14700