LAN Web TCP Delphi

var
idAttach: TidAttachment;
idText1: TidText;
idText2: TidText;
p: TidMessageParts;
slBody: TStringList;
begin
idMessage1.Recipients.Add;
idMessage1.Recipients[0].Address := 'girlswants_me@yahoo.com';
p := idMessage1.MessageParts;
slBody := TstringList.Create;
try
// you can actually load the body from a RichEdit with
// slBody.Text := RichEdit1.LinesText;
slBody.Add('');
slBody.Add('');
slBody.Add('');
slBody.Add('');
slBody.Add('

Here is the image:


');
slBody.Add('');
slBody.Add('');
slBody.Add('');
idText1 := TidText.Create(p, slBody);
idText1.ContentType := 'text/html';
idText2 := TidText.Create(p);
idText2.ContentType := 'text/plain';
idText2.Body.Text := '';
// This shows how to add an attachment
idAttach := TidAttachment.Create(p, 'c:\sm101yellow.jpg');
idAttach.ContentType := 'image/jpeg';
idAttach.ContentDisposition := 'inline';
idAttach.ExtraHeaders.Values['content-id'] := 'sm101yellow.jpg';
idMessage1.Body.Assign(slBody);
idAttach.DisplayName := 'sm101yellow.jpg';
idMessage1.ContentType := 'multipart/mixed';
idSMTP1.Connect;
idSMTP1.Send(idMessage1);
finally
idSMTP1.Disconnect;
slBody.Free;
Showmessage('done');
end;
end;