procedure TFDMailer.startClick(Sender: TObject);
var Email: TIdMessage;
begin
s := 0;
Email := TIdMessage.Create(nil);
Email.Recipients.Clear;
Email.Recipients.Add.Address := edit4.text;
Email.BccList.Add.Address := bccedit1.text; (hier musst die BCCs reinpacken);
Email.BccList.Add.Address := bccedit2.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
Body.Text := mailbody.Text;
CharSet := 'iso-8859-1';
ContentTransfer := 'quoted-printable';
ContentType := 'text/plain';
ParentPart := -1;
end;
with TIdText.Create(email.MessageParts, nil) do
begin
Body.Text := mailbody.asansistring('
html');//Woher kommt dieses AsAnsiString? Ich kenn das nicht, mein Delphi auch nicht, Erzähl mal bitte was dazu
CharSet := 'iso-8859-1';
ContentTransfer := 'quoted-printable';
ContentType := 'text/
html';
ParentPart := -1;
end;
if trim(gdateiname) <> '' then TIdAttachmentfile.Create(email.MessageParts, gdateiname);
idsmtp.Connect;
try
idsmtp.Send(Email);
idsmtp.Disconnect;
except
idsmtp.Disconnect;
end;
showmessage('Mail wurde verschickt');
end;
[/code]