Commit f367500a authored by N. Peraldi's avatar N. Peraldi
Browse files

fix: now we use a wordpress function to send mail

parent db38d39f
......@@ -142,7 +142,10 @@ function sendAdhesionMail($tab, $trash, $replacements)
}
}
$emailUser = trim($tab["mailUser"]);
$header = "Content-type: text/html; charset=utf-8 \r\n";
$header = "";
$header.="Content-type: text/html; charset=utf-8\r\n";
$header.="Content-Transfer-Encoding: 8bit\r\n";
$logMessage = "\n";
$messageAdullact = "Nouvelle requête pour le formulaire d'adhésion : <br><table>";
......@@ -154,8 +157,8 @@ function sendAdhesionMail($tab, $trash, $replacements)
$logMessage = $logMessage . $key . " : " . $value . "\n";
}
if (mail($emailUser, SUBJECT_USER, TEXT_MAIL_USER, $header)) {
mail(MAIL_CIBLE_ADULLACT, SUBJECT_ADULLACT, $messageAdullact, $header);
if (wp_mail($emailUser, html_entity_decode(SUBJECT_USER,ENT_QUOTES, 'UTF-8'), TEXT_MAIL_USER, $header)) {
wp_mail(MAIL_CIBLE_ADULLACT, html_entity_decode(SUBJECT_ADULLACT,ENT_QUOTES,'UTF-8'), $messageAdullact, $header);
writeInLog("Nouvelle demande", $logMessage);
} else {
writeInLog("Erreur de l'envoi mail.", "Header : \n" . $header . "\nInfos :" . $logMessage);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment