voilà tous fonctionne pour moi
J'ai fait un beau mail en html ou sont joint des images via les pieces jointes, je desire utiliser cette methode car par url certaines boite mail bloque les liens
Le problem que je rencontre est le suivant :
les images apparaissent ainsi que la feuille css que je joind également, mais ils apparraissent aussi en fin de page, ce qui gache réellement la presentation ...
Mon cde fonctionne pour ceux que cela interresse ..
A present comment le modifier pour que les images n'aparazissent que dans le corps du message html ?
$delim =md5(uniqid(mt_rand()));
$head="MIME-Version: 1.0\n";
$head .="Content-Type:multipart/mixed; boundary=\"$delim\"\n";
$head .="\n";
$msg="Ce message est au format MIME...\n";
$msg .="\n";
$msg .="--$delim\n";
$msg .="Content-Type: text/html; charset=\"iso-8859-1\"\n";
$msg .="Content-Transfer-Encoding:8bit\n";
$msg .="\n";
$msg .="<html>
<head>
<title>Untitled Document</title>
</head>
<LINK REL=\"stylesheet\" type=\"text/css\" HREF=\"cid:css1\">
<body bgcolor=\"#FFFFFF\" text=\"#000000\" background=\"cid:image6\" leftmargin=\"0\" topmargin=\"0\" marginwidth=\"0\" marginheight=\"0\">
<table width=\"100%\" border=\"0\" cellspacing=\"0\" height=\"215\">
<tr>
<td> </td>
</tr>
<tr>
<td align=\"center\">
<table width=\"480\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
<tr>
<td align=\"left\" valign=\"top\" bgcolor=\"#000000\"><img src=\"cid:image2\" width=\"27\" height=\"30\"></td>
<td bgcolor=\"#000000\" align=\"center\" valign=\"bottom\"><br>
<img src=\"cid:image1\" width=\"220\" height=\"79\"><br><br><div class=\"titre6\" align=\"center\" >Tremplin </div>
</td>
<td align=\"right\" valign=\"top\" bgcolor=\"#000000\"><img src=\"cid:image3\" width=\"26\" height=\"30\"></td>
</tr>
<tr>
<td bgcolor=\"#000000\"> </td>
<td bgcolor=\"#000000\" align=\"center\" valign=\"middle\">
<table width=\"100%\" border=\"0\" cellspacing=\"0\">
<tr>
<td align=\"center\" valign=\"bottom\">
<div align=\"left\">
<p><span class=\"text10\" align=\"center\" > <br>
Chères membre ... </div>
<div class=\"titre4\" align=\"center\" > 6 formations en pistes à découvrir ! ! !</div>
<br/></td>
</tr>
</table>
</td>
<td bgcolor=\"#000000\"> </td>
</tr>
<tr>
<td align=\"left\" valign=\"bottom\" bgcolor=\"#000000\"><img src=\"cid:image4\" width=\"30\" height=\"27\"></td>
<td bgcolor=\"#000000\"> </td>
<td align=\"right\" valign=\"bottom\" bgcolor=\"#000000\"><img src=\"cid:image5\" width=\"27\" height=\"30\"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td> </td>
</tr>
</table>
<div align=\"center\"></div>
</body>
</html>
";
$fichier ="./fond/terrefond.jpg";
$attache =file_get_contents($fichier);
$attache = chunk_split(base64_encode($attache));
$msg .="--$delim\n";
$msg .="Content-Type: image/jpg; name=\"$fichier\"\n";
$msg .="Content-Transfer-Encoding: base64\n";
//$msg .="Content-Disposition: attachment; filename\"$fichier\"\n"; //j'ai essayé de jouer avec ce parametre sans resultat !
$msg .="Content-ID:<image6>\n";
$msg .="\n";
$msg .="\n";
$msg .= $attache . "\n";
$msg .="\n";
$fichier ="./mail.css";
$attache =file_get_contents($fichier);
$attache = chunk_split(base64_encode($attache));
$msg .="--$delim\n";
$msg .="Content-Type: text/css; name=\"$fichier\"\n";
$msg .="Content-Transfer-Encoding: base64\n";
//$msg .="Content-Disposition: inline; filename\"$fichier\"\n";//j'ai essayé de jouer avec ce parametre sans resultat aussi !
$msg .="Content-ID:<css1>\n";
$msg .="\n";
$msg .= $attache . "\n";
$msg .="--$delim\n";
$id_connex=db_connect();
$requete="SELECT adress from forumenbre WHERE id_forumenbre = '8'";
$id_result = mysql_query ($requete,$id_connex);
if(!$id_result){echo "Lecture impossible, erreur N°", mysql_error();}
while($tabmail = mysql_fetch_array($id_result,MYSQL_ASSOC))
{
$usermail="$tabmail[adress]";
$exp="[email protected]";
$donaba = "From:$exp \nReply-To:$exp\n";
//$mesag="$html";
$post="$usermail";
mail($post, "tremplin Donaba",$msg,$donaba.$head,$attachement);
}