[PHPMailer] image inline et gMail
Bonjour,
J'ai écris un simple script basé sur phpmailer (v5) qui envoi un mail avec image intégrée. Quand j'ouvre le mail reçu dans gmail l'image n'est pas automatiquement affichée, je dois cliquer sur un lien pour l'afficher, or si j'utilise mon client mail (foxmail) pour envoyer un mail basique avec image intégrée, cette dernière est automatiquement affichée dans gmail !!
Ci-dessous le code du mail généré par phpmailer :
Code:
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 34 35 36 37 38 39 40 41 42 43 44
| X-Uidl: GmailId1348f917390fc7b8&&pop.gmail.com
Delivered-To: toto@gmail.com
X-Priority: 3
X-Mailer: PHPMailer [version 1.71]
MIME-Version: 1.0
Content-Type: multipart/related;
type="text/html";
boundary="b1_78d3c940e5e3f3bc414993157da2714a"
--b1_78d3c940e5e3f3bc414993157da2714a
Content-Type: multipart/alternative;
boundary="b2_78d3c940e5e3f3bc414993157da2714a"
--b2_78d3c940e5e3f3bc414993157da2714a
Content-Type: text/plain; charset = "iso-8859-1"
Content-Transfer-Encoding: 8bit
This is text only alternative body.
--b2_78d3c940e5e3f3bc414993157da2714a
Content-Type: text/html; charset = "iso-8859-1"
Content-Transfer-Encoding: 8bit
<h1>Test 1 of PHPMailer html</h1> <p>This is a test picture: <img src="cid:1001" /></p>
--b2_78d3c940e5e3f3bc414993157da2714a--
--b1_78d3c940e5e3f3bc414993157da2714a
Content-Type: application/octet-stream; name="images.jpg"
Content-Transfer-Encoding: base64
Content-ID: <1001>
Content-Disposition: inline; filename="images.jpg"
/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBggGEBAIBxIQEA4PEBIRDw0QDw4NDw4WExAhFRUQ
...
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/2Q==
--b1_78d3c940e5e3f3bc414993157da2714a-- |
Et ceci, celui envoyé depuis Foxmail (qui n'a pas posé de pb):
Code:
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 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
| X-Uidl: GmailId1348f917390fc7b8&&pop.gmail.com
Delivered-To: toto@gmail.com
X-mailer: Foxmail 6, 15, 201, 22 [cn]
Mime-Version: 1.0
Content-Type: multipart/related;
boundary="=====002_Dragon752044501863_=====";
type="multipart/alternative"
This is a multi-part message in MIME format.
--=====002_Dragon752044501863_=====
Content-Type: multipart/alternative;
boundary="=====003_Dragon752044501863_====="
--=====003_Dragon752044501863_=====
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Mail avec image :
FIN ./.
--=====003_Dragon752044501863_=====
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<IMG src="cid:__0@Foxmail.net"></FONT></DIV>
...
--=====003_Dragon752044501863_=====--
--=====002_Dragon752044501863_=====
Content-Type: image/jpeg;
name="images.jpg"
Content-Transfer-Encoding: base64
Content-ID: <__0@Foxmail.net>
/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBggGEBAIBxIQEA4PEBIRDw0QDw4NDw4WExAhFRUQ
...
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/2Q==
--=====002_Dragon752044501863_=====-- |
Avec phpmailer, j'ai testé en modifiant ceci
Content-Type: application/octet-stream
par ceci :
Content-Type: image/jpeg
Mais ça n'a rien donné !!
Comment faire pour que mon mail généré par phpMailer soit bien affiché ?:cry: