Hi everyone,

Can somene please explain to me how to run a telnet command using Java.I mean how can I achieve the following in Java : telnet mailServer PORT (where mailServer and PORT will be supplied)...and subequently capture response from the server.


Thanks .

Runtime.exec()
capturing the output and err streams and feeding the inputstream

or opening a socket connection and attempting the protocol yourself.

Read the API and tutorials for those, and search javaworld.com for a good document on the pitfalls of Runtime.exec

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.