Bonjour à tous !
J'utilise la fonction mail de PHP mais je n'arrive pas à afficher des backgrounds de cellules de mon tableau HTML intégré dans le mail.
Voila mon code :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?
## Test envoie Email ##
$destinataire = "XXX@gmail.com";
$sujet = "Message TEST HTML";
$expediteur = "XX@YYY.com";
$from  = "From:$expediteur\n";
$from .= "MIME-version: 1.0\nContent-type: text/html; charset= iso-8859-1\n";
 
$message = "
<table cellspacing=\"0\" style=\"border-collapse:collapse;\" width=\"600\" align=\"center\">
    <tr>
        <td width=\"600\" style=\"border-width:0; border-color:rgb(241,243,248); border-style:none;\" background=\"URL DE MON IMAGE\" height=\"96\"></td>
    </tr>
    <tr>
        <td width=\"600\" style=\"border-width:0; border-color:rgb(241,243,248); border-style:none;\" background=\"URL DE MON IMAGE 2\" height=\"81\">
            <table cellspacing=\"0\" style=\"border-collapse:collapse;\" width=\"594\">
                <tr>
                    <td width=\"14\" style=\"border-top-width:1; border-right-width:0; border-bottom-width:0; border-left-width:0; border-top-color:white; border-right-color:rgb(241,243,248); border-bottom-color:rgb(241,243,248); border-left-color:rgb(241,243,248); border-top-style:solid; border-right-style:none; border-bottom-style:none; border-left-style:none;\"><font size=\"2\" face=\"Arial\">&nbsp;</font></td>
                    <td width=\"568\" style=\"border-top-width:1; border-right-width:0; border-bottom-width:0; border-left-width:0; border-top-color:white; border-right-color:rgb(241,243,248); border-bottom-color:rgb(241,243,248); border-left-color:rgb(241,243,248); border-top-style:solid; border-right-style:none; border-bottom-style:none; border-left-style:none;\">BlaBlabla .... 
                    </td>
                    <td width=\"6\" style=\"border-top-width:1; border-right-width:0; border-bottom-width:0; border-left-width:0; border-top-color:white; border-right-color:rgb(241,243,248); border-bottom-color:rgb(241,243,248); border-left-color:rgb(241,243,248); border-top-style:solid; border-right-style:none; border-bottom-style:none; border-left-style:none;\"></td>
                </tr>
            </table>
        </td>
    </tr>
    <tr>
        <td width=\"600\" style=\"border-width:0; border-color:rgb(241,243,248); border-style:none;\" background=\"URL DE MON IMAGE 3\">&nbsp;</td>
    </tr>
</table>";
 
mail($destinataire,$sujet,$message,$from);
 
?>
L'envoie s'effectue sans problème, le texte apparait sans problème, il y a juste ce problème d'affichage de background sachant que les images ne proviennent pas du message (pas en pièce jointe) mais depuis un site distant.

Si quelqu'un peut m'aider, merci d'avance !
Bonne journée !

DJPi