var
Email: TIdMessage;
s: integer;
begin
s := 0;
Email := TIdMessage.Create(
nil);
Email.Recipients.Clear;
Email.Recipients.Add.Address := edit4.text;
Email.BccList.Add.Address := bccedit1.text;
Email.from.Text := edit3.text;
Email.From.
Name := edit2.Text;
Email.From.Address := edit1.text;
Email.Subject := T_betreff.Text;
Email.Date := Now;
with TIdText.Create(email.MessageParts,
nil)
do
begin
[b]Body.Text[/b] := mailbody.Text;
[b]CharSet[/b] := '
iso-8859-1';
[b]ContentTransfer[/b] := '
quoted-printable';
[b]ContentType[/b] := '
text/plain';
[b]ParentPart[/b] := -1;
end;
with TIdText.Create(email.MessageParts,
nil)
do
begin
Body.Text := mailbody.asansistring('
html');
CharSet := '
iso-8859-1';
ContentTransfer := '
quoted-printable';
ContentType := '
text/html';
ParentPart := -1;
end;
if trim(gdateiname) <> '
'
then TIdAttachmentfile.Create(email.MessageParts, gdateiname);