Telnet

Youngie1337

New member
Anyone know a good way to connect to telnet via Visual Basic component/API?

Need this desperate:), any help is great, thank you!.

Not this btw

ActiveSocket Network Communications Toolkit 4.1
 
Well I'd imagine you'd need to use some kind of sockets based code as Telnet is nothing more than a simple plain text server listening on a port.

I've coded in PHP to connect to Telnet / SMTP / Web and many other servers - all has had to be done using sockets :(
 
name='Jim' said:
Well I'd imagine you'd need to use some kind of sockets based code as Telnet is nothing more than a simple plain text server listening on a port.

I've coded in PHP to connect to Telnet / SMTP / Web and many other servers - all has had to be done using sockets :(

Thanks for the reply Jim.

I have managed to get a connection via a few components. And yes it's all using sockets, would you mind sharing some PHP code in which you used? That's if possible.

Cheers buddy.
 
name='Youngie1337' said:
Thanks for the reply Jim.

I have managed to get a connection via a few components. And yes it's all using sockets, would you mind sharing some PHP code in which you used? That's if possible.

Cheers buddy.

here we go mate, this is the basic part of the script that talks to an SMTP server (the hard part being getting mail headers / content types and line wrapping all right).

Code:
// ** SEND MAIL ** //

$cp = fsockopen ("10.11.12.13, 25", $errno, $errstr, 30);

$res=fgets($cp,256);

fputs($cp, "HELO \r\n");

$res=fgets($cp,256);

fputs($cp, "MAIL FROM: <noreply@overclock3d.net>\r\n");

$res=fgets($cp,256);

fputs($cp, "RCPT TO: <{$result2['email']}>\r\n");

$res=fgets($cp,256);

fputs($cp, "DATA\r\n");

$res=fgets($cp,256);

fputs($cp, "$headers$body");

$res=fgets($cp,256);

fputs($cp,"QUIT\r\n");

$res=fgets($cp,256);
 
Back
Top