title: smtp telnet python
body: <p>Having some issues getting back results from telnet library but all I am getting is header and then blank waiting for input.</p>
  
  <p>Any idea how can get the output from Telnet?</p>
  
  <pre><code>def smtp_test(server_info):
  print "Check server info: " + server_info
  cpos = server_info.find(':')
  try:
      sock = socket()
      # sock.connect((server_info[:cpos], int(server_info[cpos+1:])))
      sock.connect(("mail.SMTPSERVERNAME.com", 25))
      print sock.recv(256)
      sock.send("HELO client.example.com\r")
      print sock.recv(256)
      sock.send("MAIL from: &lt;sender@example.com&gt;\r")
      print sock.recv(256)
      #sock.send("RCPT to: &lt;recipient@example.com&gt;")
      #print sock.recv(256)
      sock.close
      return True
  except:
      return False
  </code></pre>