Код:
var
M: TIdMessage;
begin
M := TIdMessage.Create(Form1);
M.Body.Add('Текст 1');
M.Body.Add('текст 2');
M.From.Text := '"Тема';
M.Recipients.Add;
M.Recipients.Items[0].Text := '"11';
M.Subject := 'Объект';
IdSMTP1.AuthenticationType := atLogin;
IdSMTP1.Host := 'smtp-хост';
IdSMTP1.Username := 'мыло"мыло.ру;
IdSMTP1.Password := 'пасс к мылу';
IdSMTP1.Connect();
if IdSMTP1.Connected then
begin
IdSMTP1.Send(M);
end;
IdSMTP1.Disconnect;
end;
Admin: Не забываем про оформление кода, иначе последуют санкции!
П.С. Это процедура при нажатии на кнопку.