Attach property
|
SendMail component.
|
property Attach: TStringList;
|
The Attach property specifies the file names which should be included to the e-mail message on dispatching.
|
|
The Attach property is the list of strings (TStringList), where every line is the file name including full path to the file.
|
|
The files can be attached as "external" or as "internal" (embedded) data. For example, you might want to embed additional pictures to the body of HTML message. See AttachType property for more details.
|
|
If attached file could not be found (moved, renamed or deleted before sending), the OnCantAttach event occurs. However, this is not fatal error and SendMail usually continue sending the e-mail, skipping the lost file.
|
procedure TForm1.AttachBtnClick(Sender: TObject);
|
var
|
I: Integer;
|
begin
|
with OpenDialog1 do // TOpenDialog on form
|
if Execute and (I <> Files.Count) then
|
for I := 0 to Files.Count - 1 do
|
SendMail1.Attach.Add(Files[I]);
|
end;
|
AttachType property;
|
OnCantAttach event.
|