no per il testo tutto ok, risolto. Il problema è l'immagine, la invia adesso, non solo come allegato, ma non viene visualizzata, neanche con i permessi mentre in allegato si. Cmq posto il codice


procedure TForm1.Button2Click(Sender: TObject);
var
html: TStrings;
htmpart, txtpart: TIdText;
bmppart: TIdAttachment;
email: TIdMessage;
filename: string;
fileSource, fileDest: string;
begin
fileSource := 'C:\Documents and Settings\Ciccio\Desktop\us.jpg';
fileDest := 'C:\Documents and Settings\Ciccio\Desktop\Invio Mail\us.jpg';
filename := ExtractFilePath(Application.ExeName) + 'us.jpg';
html := TStringList.Create();
html.Add('<html>');
html.Add('<head>');
html.Add('</head>');
html.Add('<body><h1>Hello</h1>');
html.Add('[img]cid:us.jpg[/img]');
html.Add('This is a picture of us!</body>');
html.Add('</html>');
email := TIdMessage.Create(nil);
email.From.Text := edit4.Text;
email.Recipients.EMailAddresses :=edit3.Text;
email.Subject := 'Hello';
email.ContentType := 'multipart/mixed';
email.Body.Assign(html);
txtpart := TIdText.Create(email.MessageParts);
txtpart.ContentType := 'text/plain';
txtpart.Body.Text := '';
htmpart := TIdText.Create(email.MessageParts, html);
htmpart.ContentType := 'text/html';
bmppart := TIdAttachment.Create(email.MessageParts, filename);
bmppart.ContentType := 'image/jpeg';
bmppart.FileIsTempFile := true;
bmppart.ContentDisposition := 'inline';
bmppart.ExtraHeaders.Values['content-id'] := 'us.jpg';
bmppart.DisplayName := 'us.jpg';
IdSmtp.Username :='11111';
IdSmtp.Password :='111111';
IdSmtp.AuthenticationType := atLogin;
IdSmtp.Host :='smtp.mail.yahoo.it';
IdSmtp.MailAgent := 'Delphi';
edit3.Text:='';
idSMTP.Connect(1000);
try
idSMTP.Send(email);
finally
idSMTP.Disconnect();
email.Free();
html.Free();
CopyFile(PChar(fileSource), PChar(fileDest), False);
end;
end;


il copy mi serve in quanto è un ciclo. Grazie tante ciao Alka