Search code examples
html-email

sending html mail with images not displaying in gmail


I am sending html emails through php . the email has a background image that is not showing when i test it with gmail, hotmail or yahoo mail. I have tried to use an image tag but that doesnt work either. the image works perfectly fine if using an email client like OSX Mail or Mozilla or outlook. Any ideas?

sorry about not adding any code. here is how i tried to implement it :

    <div style="border-bottom:1px solid #CCCCCC; padding:0 20px; background-color:#EDEDED; background-image:url(http://www.mysitename.com/images/email_header.png); background-repeat: no-repeat; background-position: 520px center; height:120px;"> 
Header 
</div>

gmail works fine for displaying other attachments and pictures but i guess it blocks html images ( even if they r background images)


Solution

  • It turns out I was using CSS to have the picture in the background. Gmail didnt like that. instead i used an image tag. I cant substantiate this but : I have done that previously too with no success but what did previously is that i did not use tables for my layout. so to sum up... use tables for the layout of the html email insert image tag with width, height , alt tag and gmail , hotmail and yahoo would display ur image. hope this saves sometime for someone :)