Enviar un IcqPage con el TclientSocket
Para hacer este truco debes colocar:
Dos Tedit, un memo, un boton y el TclientSocket que para simplificar las cosas le pondremos el nombre "Icq".
El Edit1 usaremos para colocar el numero Icq del Destinatario
El Edit2 para el Subject
El memo para escribir el mensaje. (el destinatorio solo recibira los primeros 450 carateres)
Al TclientSocket le pondremos los siguientes valores en las propiedades.
Código:
Port-->80
Host-->http://wwp.icq.com
Name-->Icq (para no usar nombres largos)
En el evento "OnConnect" pondremos:
Código Delphi [-]
procedure TForm1.IcqConnect(Sender: TObject; Socket: TCustomWinSocket);
var
Pag:String;
Begin
Pag := 'POST /scripts/WWPMsg.dll HTTP/1.0' + chr(13) + chr(10);
Pag := Pag + 'Referer: http://www.clubdelphi.com' + chr(13) + chr(10);
Pag := Pag + 'User-Agent: PeterSoft (WinMe; I)' + chr(13) + chr(10);
Pag := Pag + 'Connection: Keep-Alive' + chr(13) + chr(10);
Pag := Pag + 'Host: "http://wwp.icq.com":80' + chr(13) + chr(10);
Pag := Pag + 'Content-type: application/x-www-form-urlencoded' + chr(13) + chr(10);
Pag := Pag+ 'Content-length: 80' + chr(13) + chr(10);
Pag := Pag + 'Accept:Text/html' + chr(13) + chr(10) + chr(13) + chr(10);
Pag := Pag + 'from=Pedro Luque &fromemail=pedro@luque.net.ar &subject='
+ edit2.Text + ' &body=' + memo1.text + ' &to=' + edit1.text + '&Send=';
Icq.Socket.SendText(PAg);
Icq.Active := false
end;
Y en el Click del boton:
Código Delphi [-]
procedure TForm1.Button1Click(Sender: TObject);
begin
Icq.Active:=True;
end;
Y a mandar IcqPager a lo loco :)
|