PDA

Voir la version complète : Fonction mail() & html


ashtwean
08/11/2007, 22h34
Bonjour,

J'ai crée un petit site de vente en ligne (sur un XXLplan) et lorsque le client valide sa commande, j'envoie un mail auto recapitulatif.

<?
$headers = 'From: JEPA <expedition@jepa.fr>'."\r\n";
$headers .= 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

$objet = "JEPA - Traitement de la commande n° $numero_commande";

$message .= "<html><body>";
$message .= "Numero de la commande : $numero_commande \n";
$message .= "Date de la commande : $date_courante \n";
$message .= "Detail de la Commande \n";
$message .= "$descriptif_commande";
$message .= "</body></html>";

mail("$mail_client",$objet,"$message", $header);
?>

La variable $descriptif_commande est un tableau au format html.

MON PROBLEME : le code html n'est pas interpreté dans outlook et je me retrouve avec un message du type :



<html> <body>
----------------------------------------------------------
Numero de la commande : JPCL200727110
Date de la commande : 08-11-2007
----------------------------------------------------------


Detail de la Commande
----------------------------------------------------------
<table width="100%" border="0" cellpadding="5" style="border-top:1px solid #000000;border-left:1px solid #000000;border-right:1px solid #000000;">
<tr>
<td width="16%" style="border-right:1px solid #000000;border-bottom:1px solid #000000;"> <div align="center" class="Style7">R&eacute;f&eacute;rence</div></td>
<td width="26%" style="border-right:1px solid #000000;border-bottom:1px solid #000000;"><div align="center" class="Style7">Mod&egrave;le</div></td>
<td width="27%" style="border-right:1px solid #000000;border-bottom:1px solid #000000;"><div align="center" class="Style7">D&eacute;signation</div>
<div align="center" class="Style7"></div></td>
<td width="8%" style="border-right:1px solid #000000;border-bottom:1px solid #000000;"><div align="center" class="Style7">Qt&eacute;</div></td>
<td width="12%" style="border-right:1px solid #000000;border-bottom:1px solid #000000;"><div align="center" class="Style7">P.U. Net</div></td>
<td width="11%"style="border-bottom:1px solid #000000;" ><div align="center" class="Style7">P.T H.T</div></td></tr>
</table>
<body> <html>


BREF c la M....

Une idée ?

enycu
09/11/2007, 01h54
Je vais aussi l'écrire en très très gros :D
retire du $headers ce retour charriot \r\n et remplace-le par \r