Well, I'm trying to send an email in PHP that is written with CKEDITOR, ie HTML. When the email is sent the HTML code appears in the email, I know it is from the Headers but I already tried to put it huge and none works.
Below is my code for sending the email.
function mail_users($titulo, $conteudo){
$query = mysql_query("SELECT 'Email', 'Nome' FROM 'utilizadores' WHERE 'Newsletter' = 'Ativada'");
while (($row = mysql_fetch_assoc($query)) !== false){
$header .= "MIME-Version: 1.0\r\n";
$header .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
email($row['Email'], $titulo, "Olá " . $row['Nome'] . ",\n\n" . $conteudo, $header);
}
}
Solution found
function mail_users($titulo, $conteudo){
$query = mysql_query("SELECT 'Email', 'Nome' FROM 'utilizadores' WHERE 'Newsletter' = 'Ativada'");
$header = "MIME-Version: 1.0\r\n";
$header .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
$header .= "From: [email protected]\r\n";
$header .= "Return-Path: [email protected]\r\n";
while (($row = mysql_fetch_assoc($query)) !== false){
mail($row['Email'], $titulo, "Olá " . $row['Nome'] . "," . $conteudo, $header);
}
}