avoid display button in Gmail

Swift Mailer is a fantastic library for sending email with php. Discuss this library or ask any questions about it here.

Moderators: Chris Corbyn, General Moderators

Post Reply
vincent99
Forum Newbie
Posts: 7
Joined: Fri Apr 04, 2008 9:16 am
Location: Italy

avoid display button in Gmail

Post by vincent99 »

Hi, I'm in trouble with the file_embedder plugin.
My code is like this:

Code: Select all

 
...
$plugin =& new Swift_Plugin_FileEmbedder();
$plugin->setTagDefinition("img", "src", array("gif", "png", "jpg"));
$swift->attachPlugin($plugin, "file_embedder");
 
$message =& new Swift_Message("Title");
 
$messageTxt = "text message";
 
$message->attach(new Swift_Message_Part($messageTxt ));
/*
$content contains the full html page
where images (in the same server) like:
<img src="/full/path/to/image/header.jpg"  
*/
$message->attach(new Swift_Message_Part($content 'text/html')); 
 
$swift->send($message, $eMail, $sender);
...
 
It works fine in all email clients, but i've display problems in Gmail, such as the "Display Message" button.
Where i'm wrong?

Tnx
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: avoid display button in Gmail

Post by onion2k »

I think GMail hides all the images whatever you do.
vincent99
Forum Newbie
Posts: 7
Joined: Fri Apr 04, 2008 9:16 am
Location: Italy

Re: avoid display button in Gmail

Post by vincent99 »

And what about Hotmail? I've the same problem...
Yahoo and other local accounts works perfectly
I cannot understand why

Thanx in advance
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: avoid display button in Gmail

Post by Chris Corbyn »

I was discussing this with someone else recently. It appeared Gmail was hiding images sometimes but not others. I guessed that it was down to the file size of the image, or the number of them. For gmail to display those embedded images it has some work to do so it probably tries to keep its load down.

Gmail has to extract the image attachment, base64 decode it, write to a file and then change the <img src="..." to reference that file.

I haven't looked into it further, but filesize was my best guess.
Post Reply