Archived Forum Post

Index of archived forum posts

Question:

ChilkatEmail SetHtmlBody Error (ActiveX edition)

Oct 03 '16 at 10:01

Hi Guys,

How are you?

I don't know why, but the method "SetHtmlBody " is not attaching the image to email. I can see only the content, but the image does not attach. I do not want to load the HTML content of a file. I want to load a string.

Please use this example: https://www.example-code.com/vb6/smtp_sendSimpleHtmlEmail.asp

HTML Code is here: https://1drv.ms/t/s!AlHr5OGO9BsdmIETPn-4nrzOwDlOrg

Regards, Josefh


Answer

The SetHtmlBody method simply sets the text/html body to the string that you pass to it. In this case, you have an image tag that uses:

<img src="data:image/png;base64,iVB...">

Normally, your HTML would have img tags where the src attribute contains either a URL, a relative URL, or a CID, in which case the image data is located in another MIME sub-part and identified by either Content-Location or Content-ID MIME header. The primary issue is that particular email clients are incapable of handling the format where the image data is embedded directly in the HTML. The solution is to avoid embedding image data in the HTML until email clients are capable of handling the format.


Answer

Hi Chilkat,

I Think that something is wrong... Use this sample bellow and you can send this image embedded:

Please use this example: https://www.example-code.com/vb6/smtp_sendSimpleHtmlEmail.asp

New HTML Code is here: https://1drv.ms/t/s!AlHr5OGO9BsdmIEfLdVp_i6OmpAZWQ

Regards