1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
function mail_html($destinataire, $sujet , $messtxt, $messhtml , $from)
{
$limite = "_parties_".md5 (uniqid (rand()));
$entete = "Reply-to: $from\n";
$entete .= "From:$from\n";
$entete .= "Date: ".date("l j F Y, G:i")."\n";
$entete .= "MIME-Version: 1.0\n";
$entete .= "Content-Type: multipart/alternative;\n";
$entete .= " boundary=\"----=$limite\"\n\n";
//Le message en texte simple pour les navigateurs qui
//n'acceptent pas le HTML
$texte_simple = "This is a multi-part message in MIME format.\n";
$texte_simple .= "Ceci est un message est au format MIME.\n";
$texte_simple .= "------=$limite\n";
$texte_simple .= "Content-Type: text/plain; charset=\"US-ASCII\"\n";
$texte_simple .= "Content-Transfer-Encoding: 7bit\n\n";
$texte_simple .= $messtxt;
$texte_simple .= "\n\n";
//le message en html original
$texte_html = "------=$limite\n";
$texte_html .= "Content-Type: text/html; charset=\"US-ASCII\"\n";
$texte_html .= "Content-Transfer-Encoding: 7bit\n\n";
$texte_html .= $messhtml;
$texte_html .= "\n\n\n------=$limite\n";
return mail($destinataire, $sujet, $texte_simple.$texte_html, $entete);
} |
Partager