You don't need to add HTML. HTML is only needed if you want to have a clickable reference. In other cases, you just add a mail
part with different content type. Please see:
http://en.wikipedia.org/wiki/Content_type[
^].
The standardized list of types is supported here:
http://www.iana.org/assignments/media-types/media-types.xhtml[
^].
You need these types:
http://www.iana.org/assignments/media-types/media-types.xhtml#image[
^].
Now, you need to set proper
content-disposition:
http://www.iana.org/assignments/cont-disp/cont-disp.xhtml[
^].
Basically, "inline" will cause the mail viewer to show your image in the body of the message view, and "attachment" will appear somewhere in the menu, letting the user to "download" it (but actually it will just extract the part's content and save it in a separate file).
If you really need a clickable reference in HTML, you need to add an HTML part and reference your image from there (this is usually done with "attachments", and, more often, not images). The tricky part is: how to reference this part in your
href
element? The answer is: there is a special
URL scheme for this. This is explained in my past answers:
Sending HTML attachment with images[
^],
how can i send image with text in email in asp[
^],
How to attach a file in smtp mail implementation[
^].
—SA