Inline Graphics

Giganews Newsgroups
Subject: Inline Graphics
Posted by:  Alan McDonald (al…@meta.com.au)
Date: Tue, 12 Feb 2008

I use the components fine for multipartr HTML emails with attachements, but
I'd like to put a grphic in my email header which is actually inline and not
just referenced via the html src tag.
I can't find any example code for this. Is there any?
thanks
Alan

PS I do this sort of thing - so I imagine that an inline grphic is another
part but I also need to reference it in the body text somehow,.

emailBody1 := TIdText.Create(IdMessage1.MessageParts, nil);
    emailBody1.ContentType := 'multipart/alternative';

    emailBody2 := TIdText.Create(IdMessage1.MessageParts, nil);
    emailBody2.Body.Text := HtmlToText(InvNotice.Text);
    emailBody2.ContentType := 'text/plain';
    emailBody2.ParentPart := 0;

    emailBody3 := TIdText.Create(IdMessage1.MessageParts, nil);
    emailBody3.Body.Text := InvNotice.Text;
    emailBody3.ContentType := 'text/html';
    emailBody3.ParentPart := 0;

    InvAttach := TIdAttachmentFile.Create(IdMessage1.MessageParts,
eDocument);
    InvAttach.ContentType := GetMIMETypeFromFile(eDocument);
    InvAttach.FileName := eDocument;

    IdMessage1.ContentType := 'multipart/related;
type="multipart/alternative"';

    IdSMTP1.Send(idMessage1);
    InvAttach.Free;
    emailBody1.Free;
    emailBody2.Free;
    emailBody3.Free;

Replies