0
I’m using the function mail()
PHP to try to send some data that is informed in my form; the function is returning true
only the email never reaches the recipient. Below is the PHP code:
$headers = 'From: ServidorCafé <[email protected]>'."\r\n" .
'MIME-Version: 1.0' . "\r\n".
"Return-Path: contato <[email protected]>\r\n".
'Content-type: text/html; charset=UTF-8' . "\r\n";
$envia = mail('[email protected]', 'Pesquisa preenchida', $corpo, $headers);
if($envia){
echo '<div align="center" style="height:30px;width:100%; background-color:green; color:#fff; font-size:13px; font-family:Verdana">Mensagem enviada com sucesso!</div>';
}
in $body is the HTML form I made with <table>
Have you seen the spam box? If the addressee is Hotmail, every email sent by the mail will go to spam. Switch to a gmail addressee. See the PHP version of your server if it is 5. NOTE:
– Lollipop
Not in spam. Version 5 of PHP.
– Alisson Acioli
Wait. I’ll send you a code.
– Lollipop
Try to remove the accent in Servorcafé. I’ve had problems with special characters in sending email.
– Oeslei
@Alissonacioli Why function
mail
returnedTRUE
does not mean that the email reached the recipient, it just means that it reached the "email service" of your server and probably got in the queue (correct me if I’m wrong). There is a probability of having a problem with your SMTP, or in Hotmail the "IP of your server" is blocked (it is only theory). Have you ever thought of using an SMTP instead ofmail
? Many developers go through these difficulties with the functionmail
.– Guilherme Nascimento
Where are you testing? Location? Server? Where is hosted?
– abfurlan