Re: [Evolution-hackers] attaching image and displaying inline in HTML e-mail like smilies



On Sun, 2003-03-02 at 07:38, Rob Kirk wrote:
> Not sure if this is the correct list on which to ask this question....
> (by the way, I'm lovin' evolution)
> 
> I would like to attach an image to my HTML e-mail but display it
> inline in the HTML, not just suggest that it be displayed
> automatically.  If you insert a smilie into an HTML e-mail, this is
> what I want to do, except with images other than smilies.
> 
> Is there some help/docs somewhere outlining how Evolution handles
> e-mail attachments at the MIME level?  If not, could somebody point me
> in the right direction in the code and I'll dig around a bit.

Mainly in mail/mail-format.c and mail/mail-display.c.  The stuff in
composer, or maybe gtkhtml generates stuff when you send it.

The basic idea is:

You generate a multipart/related

the first part is text/html

any inline images are refernced as in

<img src="cid:some-unique-string-x"> ...

subsequent parts include the images, with an appropriate "Content-ID"
header matching the cid's referenced in the html.

e.g.

--xxx
Content-Type: image/png
Content-Transfer-Encoding: base64
Content-ID: some-unique-string-x

MMMXXFJAJDFJAFDADS...


If you want to also provide a text-only version for text-only viewers,
you wrap the whole lot in a multipart/alternative, and i think include a
text/plain part as the first part in the alternative, followed by the
whole multipart/related in the second part.  Either that or the other
way around, the mime rfc's explain the ordering you use.  rfc2045, 2046,
2047 and maybe a couple of others around there.

> Also, general references to HTML e-mail resources would be appreciated
> (please e-mail them to me directly since this isn't directly related
> to this list).

I'd suggest googling, if we looked up docs developing it, they're
probably long forgotten.  The mime rfc's might cover some of it,
although they predate html i think.






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]