Code:
procedure TfrmMail.[color=#ff001f]Mail[/color](Receiver, Subject, AttFilename: string; Body: TStrings);
var
[color=#ff001f]Mail[/color] : TIdMessage;
Att : TIdAttachment;
begin
IdSMTP1.Host := 'luckie-online.de';
IdSMTP1.Username := 'bar';
IdSMTP1.Password := 'foo';
IdSMTP1.Connect;
Mail := TIdMessage.Create(frmMail);
try
Mail.Clear;
[b][...][/b]
Att := TIdAttachment.Create(Mail.MessageParts);
Att.FileName := AttFilename;
[color=#ff001f]IdSMTP1.Send(Mail);[/color]
finally
FreeAndNil(Att);
IdSMTP1.Disconnect;
end;
end;
Ändere mal die Variable oder ned Namen der Procedur.