unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient,
IdFTP, StdCtrls, IdUDPBase, IdUDPClient, IdTrivialFTP, IdTCPServer,
IdFTPServer, Sockets, IdMessageClient, IdPOP3, IdSMTP, IdNNTP,IdMessage;
type
TForm1 =
class(TForm)
IdFTP1: TIdFTP;
Edit1: TEdit;
Edit2: TEdit;
Label1: TLabel;
Label2: TLabel;
Button2: TButton;
Button3: TButton;
ListBox1: TListBox;
IdSMTP1: TIdSMTP;
IdMessage1: TIdMessage;
procedure FormCreate(Sender: TObject);
procedure Button3Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
Inhalt:TStringList;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
Inhalt := TStringList.Create;
IdFTP1.Host := '
*****';
IdFTP1.Username:='
*****';
IdFTP1.Password:='
*******';
IdFTP1.Connect;
IdFTP1.Login;
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
IdFTP1.List(listbox1.items,'
/'+Edit1.Text,true);
if(listbox1.Items.Text = '
')
then
begin
IdSMTP1.Username := '
********';
IdSMTP1.Password := '
*****';
IdSMTP1.Host := '
smtp.mail.yahoo.de';
IdSMTP1.Connect;
Inhalt.Add(Edit1.Text);
Inhalt.Add(Edit2.Text);
IdMessage1.Body := inhalt;
ShowMessage('
Du wurdest registriert');
IdSMTP1.Send(IdMessage1);
IdFTP1.MakeDir(Edit1.Text);
Inhalt.SaveToFile('
c:\'+Edit1.Text+'
.txt');
IdFTP1.Put('
c:\'+Edit1.Text+'
.txt',
ExtractFileName(Edit1.Text+'
/'+Edit1.Text+'
.txt'));
deletefile('
c:\'+Edit1.text+'
.txt');
end;
end;
end.