Désolé de revenir avec ce sujet, mais il faut a tout prix que je resolve mon probleme!!!
Alors voila, sur le site que je suis en train de developper pour une boite, je dois envoyer un mail de bon de commande. Comme je veux structurer mon, mail, j'utilise du html, afin de mettre les differents produits commandés dans un tableau. Mais, gros probleme : le html n'est pas toujours interprété (comme sur Outlook par exemple...).
Donc, il faut soit que je trouve un moyen pour que le code soit toujours interpreté (peut etre est-ce faisable en configurant d'une certaine maniere se boite mail????), soit que je présente le bon de commande d'une autre maniere (c'est a dire pas en html) mais je ne vois pas du tout comment.
Donc toutes les idées sont les bienvenues, alors n'hésitez pas. Merci :-)
J'ai effectivement récuperer le script d'un certain Loic, mais ca ne marche toujours pas, toujours le meme probleme, je me retrouve avec toutes mes balises html lorsque je visualise mon mail, donc c'est illisible...
Ce qui est curieux, c'est que j'ai l'impression d'etre le seul de la planete a avoir rencontré ce probleme! :-(
In response to jcwebb's excellent post regarding multipart/alternative
and attachments: the code works great in sending attachments, but I got
inconsistent results across different email clients (MS Outlook worked,
but Thunderbird and mutt didn't) when displaying the HTML/plain text
alternate portion.
To fix this, you need to define a new MIME boundary for the HTML/Plain
text alternates section ONLY - this way you can "nest" the two together
so the alternate works properly in all email clients.
here's a modified version of the code for the message body only (see jcwebb's post for the entire message code)
<?
$msg = "";
# Attachment
$msg .= "--".$mime_boundary.$eol;
$msg .= "Content-Type: application/pdf; name="".$letter.""".$eol; // sometimes i have to send MS Word, use 'msword' instead of 'pdf'
$msg .= "Content-Transfer-Encoding: base64".$eol;
$msg .= "Content-Disposition: attachment; filename="".$letter.""".$eol.$eol; // !! This line needs TWO end of lines !! IMPORTANT !!
$msg .= $f_contents.$eol.$eol;
# Setup for text OR html -
$msg .= "--".$mime_boundary.$eol;
$htmlalt_mime_boundary = $mime_boundary."_htmlalt"; //we must define a different MIME boundary for this section for the alternative to work properly in all email clients
$msg .= "Content-Type: multipart/alternative; boundary="".$htmlalt_mime_boundary.""".$eol;
# Text Version
$msg .= "--".$htmlalt_mime_boundary.$eol;
$msg .= "Content-Type: text/plain; charset=iso-8859-1".$eol;
$msg .= "Content-Transfer-Encoding: 8bit".$eol;
$msg .= "This is a multi-part message in MIME format.".$eol;
$msg .= "If you are reading this, please update your email-reading-software.".$eol;
$msg .= "+ + Text Only Email from Genius Jon + +".$eol.$eol;
# HTML Version
$msg .= "--".$htmlalt_mime_boundary.$eol;
$msg .= "Content-Type: text/html; charset=iso-8859-1".$eol;
$msg .= "Content-Transfer-Encoding: 8bit".$eol;
$msg .= $body.$eol.$eol;
//close the html/plain text alternate portion
$msg .= "--".$htmlalt_mime_boundary."--".$eol.$eol;
# Finished
$msg .= "--".$mime_boundary."--".$eol.$eol;
?>
En esperant que ça aide un peu
++
Vous n’avez pas trouvé la réponse que vous recherchez ?