PHP's native mail () function returns true and does not send mail

1

Good morning!

I have a stone in my shoe that I need guidance. By means of a separate file (which I am calling function_email.php) inside my "include" folder in the root, I created a function (based on mail) PHP that sends emails when called on PHP pages. The blessed problem is that when it is called, it returns TRUE, but, the email does not reach the recipient.

Now, on the first day, I overexpressed Hotmail, and it was not even brave. So I decided to test the GMAIL and it worked. The email arrived everything working perfectly. After three days, I went to test it again for thinking that Hotmail was on maintenance that day or something, and the result surprised me. The function keeps returning True but none of the providers (or anyone) receives the email.

function sentRegister($usuario, $senha, $email) {
    $subject = "Bem-vindo(a) ao nosso site!";
    $headers = "MIME-Version: 1.0\r\n";
    $headers .= "Content-type: text/html; charset=UTF-8\r\n";
    $headers .= "From: [email protected] \r\n";

    $mensagem = '<p>EMAIL TESTE COM: '.$email.' e '.$senha.' mais o '.$usuario.'</p>';

    // START SENT MAIL FUNCTION
    mail($email, $subject, $mensagem, $headers);
}

This is the PHP function, and I normally call it using the IF:

if($usuario_inserido) {sentRegister($usuario, $senha, $email);)

Obviously, the $ user, $ password, and $ email variables return data coming from $ _POST. And I confirm that they are returning values, so I tested them. :)

Would anyone know to tell me what I might be missing?

    
asked by anonymous 11.11.2017 / 18:01

0 answers