Zip Component, Email Component, Encryption Component ActiveX Control for Zip Compression .NET Components for ASP.NET
ActiveX and .NET Components for Zip Compression, Encryption, Email, XML, S/MIME, HTML Email, Character Encoding, Digital Certificates, FTP, and more ASP Email ActiveX Component

  

  

  

  

  

 

Sending HTML Email with Embedded Images to Gmail Accounts

Most email clients nowadays will (by default) suppress the display of images in HTML email to prevent spammers from knowing that an email was received and read. (An image URL encoded with a string that identifies the recipient is a way of letting the email sender know that the recipient has received the email. Typically, the HTTP request for the image is handled by server-side software that maps the URL to an email address, records the information, and serves the image to fulfill the HTTP request.)

Gmail is no exception. By default, images within HTML email are not displayed. Unfortunately, many email clients do not distinguish between externally reference images and images that are embedded within the MIME source of an HTML email. When an image is embedded with a "cid" internal link, no HTTP request occurs, and therefore there is no communication back to an external server. Regardless, the images are suppressed by Gmail and other mail clients.

Here is an example of how a message is displayed in GMail with images suppressed:

After clicking on the "Display images below" link, the email displays correctly.



The email in this example was sent using this VBScript using the Chilkat Email ActiveX component.

set mm = CreateObject("ChilkatMail2.ChilkatMailMan2")
mm.UnlockComponent "30-day trial"

mm.SmtpHost = "smtp.***.net"

set email = CreateObject("ChilkatMail2.ChilkatEmail2")
email.Subject = "2nd test HTML email with embedded graphic"
email.AddTo "Chilkat Support","chilkat.support@gmail.com"

cid = email.AddRelatedFile("dudeMail.gif")

email.SetHtmlBody "<html><body>This is a test 2<br><img src=""cid:" + cid + """><br>This is a test</body></html>"
email.From = "Chilkat <support@chilkatsoft.com>"

mm.SendEmail email


Privacy Statement. Copyright 2000-2012 Chilkat Software, Inc. All rights reserved.

(Regarding the usage of the Android logo) Portions of this page are reproduced from work created and shared by Google and used according to terms described in the Creative Commons 3.0 Attribution License.

Send feedback to support@chilkatsoft.com


Software components and libraries for Linux, MAC OS X, IOS (IPhone), Android™, QNX, Solaris, HP-UX, RHEL/CentOS
Microsoft Windows 7, Vista, XP, 2000, 2003 Server, 2008 Server, and Windows 95/98/NT4.