bonsoir j'ai créé un script qui me permet d'envoyer des mails en incluant des fichiers joints dans le mail! Mon probleme est que le mail passe avec hotmail,yahoo,neuf mais ne passe pas avec gmail et outlook! outlook ne recoit pas mon mail et gmail réécrit mon script au lieu de l'afficher! a l'aide...
voici mon script:
<? include("style.inc"); //destinataire : $add = "
k.beta@gmail.com"; // sujet : $subject = $_POST['sujet']; // message : $delimiteur="-----=".md5(uniqid(rand())); $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: multipart/related; boundary=\"$delimiteur\"\r\n"; $headers .= "\r\n"; $msg="Je vous informe que ceci est un message au format MIME 1.0 multipart/mixed.\r\n"; $msg .= "--$delimiteur\r\n"; $msg .= "Content-Type: text/html; charset=\"iso-8859-1\"\r\n"; $msg .= "Content-Transfer-Encoding:8bit\r\n"; $msg .= "\r\n"; $msg .="<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\"> <HTML><HEAD><TITLE>Document sans titre</TITLE> </HEAD> <BODY> <TABLE cellSpacing=0 cellPadding=0 width=672 border=0> <TBODY> <TR> <TD width=119><A href=\"<A href="http://www.alfa.fr/index.html\"><IMG">http://www.alfa.fr/index.html\"><IMG src=\"cid:image1\" width=\"119\" height=\"104\" border=\"0\"></A></TD> <TD width=325><A href=\"<A href="http://www.alfa.fr/index.html\"><IMG">http://www.alfa.fr/index.html\"><IMG height=104 src=\"cid:image2\" width=325 border=0></A></TD> <TD> </TD> <TD vAlign=top align=right width=215> <DIV align=center><IMG height=35 src=\"cid:image3\" width=214><BR><BR></DIV></TD> <TD width=15> </TD></TR></TBODY></TABLE> <TABLE cellSpacing=0 cellPadding=0 width=672 border=0> <TBODY> <TR> <TD width=119> </TD> <TD vAlign=top background=\"cid:image4\"> <TABLE cellSpacing=0 cellPadding=0 width=420 border=0> <TBODY> <TR> <TD height=22> </TD> <TD height=22> </TD> <TD height=22> </TD></TR> <TR> <TD width=140> </TD> <TD>".$txtblc."Vos cours de musique<BR>à domicile, rendez-vous sur".$txtblc_fin."<BR> <A href=\"<A href="http://www.alfa.fr\">".$txtblc."http://www.allegromusique.fr".$txtblc_fin."</A></TD">http://www.alfa.fr\">".$txtblc."http://www.allegromusique.fr".$txtblc_fin."</A></TD> <TD width=40> </TD></TR></TBODY></TABLE><BR></TD> <TD width=109 bgcolor=$grisclair></TD></TR></TBODY></TABLE> <TABLE cellSpacing=0 cellPadding=0 width=672 border=0> <TBODY> <TR> <TD width=119> </TD> <TD vAlign=top> <TABLE height=379 cellSpacing=0 cellPadding=0 width=444 border=0> <TBODY> <TR> <TD width=1 bgcolor=$grisclair></TD> <TD vAlign=top colSpan=2> <TABLE cellSpacing=0 cellPadding=0 width=440 border=0> <TBODY> <TR> <TD width=25> </TD> <TD><BR>".$txtgris.transcript($_POST["entete"]).$txtgris_fin." <TABLE cellSpacing=0 cellPadding=0 width=400 border=0> <TBODY> <TR> ".colonnes()." </TR></TBODY></TABLE> <TABLE cellSpacing=0 cellPadding=0 width=400 bgcolor=".$fondgris." border=0> <TBODY> <TR> <TD vAlign=top align=right colSpan=3><IMG height=15 src=\"cid:image5\" width=16></TD></TR> <TR> <TD colSpan=3> ".$txtblc .transcript($_POST["titrebas"]). $txtblc_fin."</TD></TR> <TR> <TD colSpan=3 height=\"18\"> <HR> </TD></TR> <TR> <TD vAlign=top align=right width=10> </TD> <TD background= colSpan=2> <TABLE > <TBODY ><TD vAlign=top >".$txtblcf.transcript($_POST["pied"]).$txtblcf_fin."</TD></TBODY></TABLE></TD></TR></TBODY></TABLE> <DIV align=center><BR><IMG height=35 src=\"cid:image3\" width=214><BR><BR></DIV></TD> <TD width=10> </TD></TR></TBODY></TABLE></TD></TR> <TR> <TD width=1 bgclor=$grisclair height=1></TD> <TD bgclor=$grisclair height=1></TD> <TD width=150 bgclor=$grisclair height=1></TD></TR></TBODY></TABLE></TD> <TD vAlign=top width=109 bgcolor=$grisclair><A href=\"
http://www.alfa.fr/popv2.htm\" target=_blank><IMG height=58 alt=\"Faites-vous appeler gratuitement\" src=\"cid:image6\" width=109 border=0></A><BR> <TABLE cellSpacing=0 cellPadding=0 width=108 border=0> <TBODY> <TR> <TD width=10> </TD> <TD>".$textecourant2."Un conseiller <BR>pédagogique <BR>est à l'ecoute <BR><A href=\"
http://www.alfa.fr/popv2.htm\" target=_blank>". $lienrouge."cliquez ici".$lienrouge_fin."</A></TD></TR></TBODY></TABLE><BR><A href=\"<A href="http://www.alfa.fr/contact.html\"><IMG">http://www.alfa.fr/contact.html\"><IMG height=58 src=\"cid:image7\" width=109 border=0></A> <TABLE cellSpacing=0 cellPadding=0 width=108 border=0> <TBODY> <TR> <TD width=10> </TD> <TD>".$textecourant2."Vous souhaitez<BR>recevoir une documentation, <BR><A href=\"
http://www.alfa.fr/contact.html\">". $lienrouge."cliquez ici".$lienrouge_fin."</A></TD></TR></TBODY></TABLE><BR><A href=\"<A href="http://www.alfa.fr/inscription.php\"><IMG">http://www.alfa.fr/inscription.php\"><IMG height=58 src=\"cid:image8\" width=109 border=0></A><BR> <TABLE cellSpacing=0 cellPadding=0 width=108 border=0> <TBODY> <TR> <TD width=10> </TD> <TD>".$textecourant2."Vous souhaitez<BR>vous inscrire, <BR> <A href=\"
http://www.alfa.fr/inscription.php\">". $lienrouge."cliquez ici".$lienrouge_fin." </A></TD></TR></TBODY></TABLE> <P> </P></TD></TR></TBODY></TABLE> <TABLE cellSpacing=0 cellPadding=0 width=688 border=0> <TBODY> <TR> <TD height=20> <DIV align=center>".$textecourant2."Vous ne souhaitez plus recevoir la newsletter, " ."<A href=\"
http://www.alfa.fr/desabonner.html\">". $lienrouge."desabonnez-vous".$lienrouge_fin."</A></DIV></TD> <TD width=16 bgcolor=$fondgris></TD></TR></TBODY></TABLE></BODY></HTML>"; $msg .= "\r\n"; $fichier = "images/logo.gif"; $fp = fopen($fichier, "rb"); $fichierattache = fread($fp, filesize($fichier)); fclose($fp); $fichierattache = chunk_split(base64_encode($fichierattache)); $msg .= "--$delimiteur\r\n"; $msg .= "Content-Type: application/octet-stream; name=\"$fichier\"\r\n"; $msg .= "Content-Transfer-Encoding: base64\r\n"; $msg .= "Content-ID: <image1>\r\n"; $msg .= "\r\n"; $msg .= $fichierattache . "\r\n"; $msg .= "\r\n\r\n"; $fichier1 = "images/signature.gif"; $fp = fopen($fichier1, "rb"); $fichierattache1 = fread($fp, filesize($fichier1)); fclose($fp); $fichierattache1 = chunk_split(base64_encode($fichierattache1)); $msg .= "--$delimiteur\r\n"; $msg .= "Content-Type: application/octet-stream; name=\"$fichier1\"\r\n"; $msg .= "Content-Transfer-Encoding: base64\r\n"; $msg .= "Content-ID: <image2>\r\n"; $msg .= "\r\n"; $msg .= $fichierattache1 . "\r\n"; $msg .= "\r\n\r\n"; $fichier2 = "images/azur2.gif"; $fp = fopen($fichier2, "rb"); $fichierattache2 = fread($fp, filesize($fichier2)); fclose($fp); $fichierattache2 = chunk_split(base64_encode($fichierattache2)); $msg .= "--$delimiteur\r\n"; $msg .= "Content-Type: application/octet-stream; name=\"$fichier2\"\r\n"; $msg .= "Content-Transfer-Encoding: base64\r\n"; $msg .= "Content-ID: <image3>\r\n"; $msg .= "\r\n"; $msg .= $fichierattache2 . "\r\n"; $msg .= "\r\n\r\n"; $fichier3 = "images/fondnews.gif"; $fp = fopen($fichier3, "rb"); $fichierattache3 = fread($fp, filesize($fichier3)); fclose($fp); $fichierattache3 = chunk_split(base64_encode($fichierattache3)); $msg .= "--$delimiteur\r\n"; $msg .= "Content-Type: application/octet-stream; name=\"$fichier3\"\r\n"; $msg .= "Content-Transfer-Encoding: base64\r\n"; $msg .= "Content-ID: <image4>\r\n"; $msg .= "\r\n"; $msg .= $fichierattache3 . "\r\n"; $msg .= "\r\n\r\n"; $fichier4 = "images/coingrismoy.gif"; $fp = fopen($fichier4, "rb"); $fichierattache4 = fread($fp, filesize($fichier4)); fclose($fp); $fichierattache4 = chunk_split(base64_encode($fichierattache4)); $msg .= "--$delimiteur\r\n"; $msg .= "Content-Type: application/octet-stream; name=\"$fichier4\"\r\n"; $msg .= "Content-Transfer-Encoding: base64\r\n"; $msg .= "Content-ID: <image5>\r\n"; $msg .= "\r\n"; $msg .= $fichierattache4 . "\r\n"; $msg .= "\r\n\r\n"; $fichier5 = "images/appel.gif"; $fp = fopen($fichier5, "rb"); $fichierattache5 = fread($fp, filesize($fichier5)); fclose($fp); $fichierattache5 = chunk_split(base64_encode($fichierattache5)); $msg .= "--$delimiteur\r\n"; $msg .= "Content-Type: application/octet-stream; name=\"$fichier5\"\r\n"; $msg .= "Content-Transfer-Encoding: base64\r\n"; $msg .= "Content-ID: <image6>\r\n"; $msg .= "\r\n"; $msg .= $fichierattache5 . "\r\n"; $msg .= "\r\n\r\n"; $fichier6 = "images/doc.gif"; $fp = fopen($fichier6, "rb"); $fichierattache6 = fread($fp, filesize($fichier6)); fclose($fp); $fichierattache6 = chunk_split(base64_encode($fichierattache6)); $msg .= "--$delimiteur\r\n"; $msg .= "Content-Type: application/octet-stream; name=\"$fichier6\"\r\n"; $msg .= "Content-Transfer-Encoding: base64\r\n"; $msg .= "Content-ID: <image7>\r\n"; $msg .= "\r\n"; $msg .= $fichierattache6 . "\r\n"; $msg .= "\r\n\r\n"; $fichier7 = "images/inscr.gif"; $fp = fopen($fichier7, "rb"); $fichierattache7 = fread($fp, filesize($fichier7)); fclose($fp); $fichierattache7 = chunk_split(base64_encode($fichierattache7)); $msg .= "--$delimiteur\r\n"; $msg .= "Content-Type: application/octet-stream; name=\"$fichier7\"\r\n"; $msg .= "Content-Transfer-Encoding: base64\r\n"; $msg .= "Content-ID: <image8>\r\n"; $msg .= "\r\n"; $msg .= $fichierattache7 . "\r\n"; $msg .= "\r\n\r\n"; $expediteur = "
noreply@alfa.fr"; $reponse = $expediteur; // D'autres en-têtes : errors, From cc's, bcc's, etc : // Pour envoyer du mail au format html, vous pouvez configurer le type content-type : mail($add, $subject, $msg, "Reply-to: $reponse\r\nFrom: $expediteur\r\n".$headers); ?>
[/LEFT]