unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls,IdMultipartFormData, IdBaseComponent, IdComponent,
IdTCPConnection, IdTCPClient, IdHTTP;
type
TForm1 =
class(TForm)
Memo1: TMemo;
Button1: TButton;
IdHTTP1: TIdHTTP;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Label4: TLabel;
procedure Button1Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
data: TIdMultiPartFormDataStream;
begin
data := TIdMultiPartFormDataStream.Create;
try
{ add the used parameters for the script }
data.AddFormField('
zu', Edit3.Text);
data.AddFormField('
betreff', Edit1.Text);
data.AddFormField('
text', Memo1.text);
data.AddFormField('
von', Edit2.Text);
{ Call the Post method of TIdHTTP and read the result into TMemo }
Memo1.Lines.Text := form1.IdHTTP1.Post('
http://www.domain.de/mail.php', data);
finally
data.Free;
end;
end;
end.