Mail Function PHP does not work [closed]

0
Hello, I have tried to send an email through the PHP mail function, but nothing works, and after a little research, I found a website that said that it was necessary to have a fifth parameter, being it the email that will receive the message, preceded of a -f , and it does not work, here is what I have so far:

$dest = "[email protected]";
$nome = $_POST['nome'];
$email = $_POST['email'];
$assunto = $_POST['assunto'];
$header = "MIME-Version: 1.1 \r\n";
$header .= "Content-type: text/plain; charset=iso-8859-1 \r\n";
$header .= "From: $email \r\n"; 
$header .= "Return-Path: $email \r\n";
$header .= "Reply-To: $dest \r\n"; 
$msg = $_POST['text'];

$mail = mail($dest, $assunto, $msg, $header, -f$dest);

And I have no idea what it might be, I've tried so many things ...

    
asked by anonymous 11.11.2015 / 18:28

1 answer

2

I use this form, and turning base64 into email.

    $para="[email protected]";
    $assunto ="assunto Teste";
    $html="Olá esse é o conteudo do email";
    $headers = "From: Email do teste<[email protected]> \r\n";
    $headers .= "Reply-To:[email protected]\r\n";
    $headers .= "MIME-Version: 1.0\r\n";
    $headers .= "Content-Type: text/html; charset=UTF-8\r\n";
    $headers.= "Content-Transfer-Encoding: base64\r\n";
    $headers .= rtrim(chunk_split(base64_encode($html)));

    $ok = mail($para , $assunto,'',$headers);
    echo $ok;
    
11.11.2015 / 18:38