"Jonathan Hyams" <✉btopenworld.com> wrote in message news:✉btopenworld.com...
> Here's my code:
for HTML to work correctly. Try this instead:
var Folder: String begin Folder := ExtractFilePath(Application.ExeName);
//...
MyMessage.IsEncoded := True ; MyMessage.ContentType := 'multipart/alternative'; MyMessage.ClearBody;
with TIdText.Create(MyMessage.MessageParts, nil) do begin Body.Text := 'Your reader does not support HTML'; ContentType := 'text/plain'; end;
with TIdText.Create(myMessage.MessageParts, nil) do begin ContentType := 'multipart/related; type="text/html"'; end;
with TIdText.Create(myMessage.MessageParts, nil) do begin Body.LoadFromFile(Folder + 'htmlmail.htm'); ContentType := 'text/html'; ParentPart := 1; end;
with TIdAttachmentFile.Create(myMessage.MessageParts, Folder + 'image001.jpg') do begin ContentID := '10001'; ContentType := 'image/jpeg'; ContentDisposition := 'inline'; ParentPart := 1; end;
//... end;
Gambit