I don't understand what you mean when you say 'it woking fine,but after running this script,i unable to connect to remote server'. Did you take the advice I gave in Telnet connection problem regards debugging this problem?
Martin
Comment on Re: Problem to connect remote server by using telnet module