You need to use a telnet device driver in your terminal program. Theres two available on Aminet, telser and telnetd
Change the device from serial.device or whatever to the telnet device you chose to use, and you can then use it to "dial" out over your internet connection
Usage is covered in the documentation of the telnet device drivers