Cabeçalhos de E-mail HTML
tenho o PHP e o Postfix no meu servidor Ubuntu. Preciso de enviar um e-mail HTML do programa PHP. O e-mail é enviado muito bem, mas é mostrado como texto simples com tags HTML incluídos. Além disso, alguns cabeçalhos também são exibidos no próprio E-mail.
O meu palpite é que tem algo a ver com os cabeçalhos. Passei quase um dia à procura de uma solução possível e não encontrei nenhuma.Aqui está o código PHP:
$headers='';
$headers.="MIME-Version: 1.0 \r\n";
$headers.="Content-type: text/html; charset=\"UTF-8\" \r\n";
$headers.="From: ".FROM_EMAIL."\r\n";
mail($email, $vars['title'], $content, $headers);
editar:
$headers='';
$headers.='MIME-Version: 1.0'."\r\n";
$headers.='Content-type: text/html; charset=iso-8859-1'."\r\n";
$headers.='From: Kinesioteip.ee<'.FROM_EMAIL.'>'."\r\n";
$headers.='To: '.$email."\r\n";
mail($email, $vars['title'], $content, $headers);
Ainda não. sorte...
4
Author: Jaagup Kümmel, 2012-05-01
3 answers
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
// Additional headers
$headers .= 'To:' . "\r\n";
$headers .= 'From: Admin<[email protected]>' . "\r\n";
// Mail it
mail($to, $subject, $message, $headers);
5
Author: Ravi Jethva, 2012-05-01 10:38:54
Pode tentar mudar estas linhas?
$headers.="MIME-Version: 1.0 \r\n";
$headers.="Content-type: text/html; charset=\"UTF-8\" \r\n";
A
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
E ver se funcionam
2
Author: Satya, 2012-05-01 10:39:51
Acho que o teu quarto cabeçalho está errado porque a variável FROM_EMAIL não tem ' $ '
Tenta
$headers.="From: ".$FROM_EMAIL."\r\n";
$vars ['título'] mudar para $var
mail($email, $vars, $content, $headers);
-1
Author: srini, 2012-05-01 11:04:47