[Mail] Forme texte ET html
Je voudrais envoyer un mail qui s'affiche au format html quand le client accepte le html et sinon affiche un mail au format texte si ce n'est pas le cas.
En cherchant a droite a gauche je suis arrivé a ce code:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| $this->Headers = "To:<'$mail'>\n";
$this->Headers .= "From: <'$from'>\n";
$this->Headers .= "MIME-Version: 1.0\n";
$this->Headers .= "\r\nContent-Type: multipart/alternative; boundary=\"==Multipart_Boundary_".$random_hash."\"";
ob_start();
?>
--==Multipart_Boundary_<?php echo $random_hash; ?>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
#text_simple
--==Multipart_Boundary_<?php echo $random_hash; ?>
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
#text_html
--PHP-alt-<?php echo $random_hash; ?>--
<?php
$this->Message = ob_get_clean(); |
Et le probleme c'est qui marche pas^^
J'avais trouvé un exempl sur http://www.webcheatsheet.com
et quand je fais un copier/coller ca marche pas non plus...
Donc voila si quelqu'un sais comment faire sa pourrai m'aider^^