title: python3 smtplib creating the smtp server obj is very slow
body: <p>I am trying to write a python3 script that will send an email with a pdf attachment for me. I am following a <a href="https://www.youtube.com/watch?v=I82GJrzeaIs" rel="nofollow noreferrer">video tutorial</a> and have created the smtp server obj as follows:</p>
  
  <pre><code>Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:01:18) [MSC v.1900 32 bit (Intel)] on win32
  Type "copyright", "credits" or "license()" for more information.
  
  &gt;&gt;&gt; import smtplib
  &gt;&gt;&gt; server=smtplib.SMTP('smtp.gmail.com',587)
  </code></pre>
  
  <p>This is where the code hangs and I don't know why.
  I tried to include a timeout statement below of 5 seconds and it still hangs for more then 5 seconds.</p>
  
  <pre><code>&gt;&gt;&gt; import smtplib
  &gt;&gt;&gt; server=smtplib.SMTP('smtp.gmail.com',587,5)
  
  ping smtp.gmail.com
  Reply from 173.194.200.108: bytes=32 time=35ms TTL=41
  Reply from 173.194.200.108: bytes=32 time=35ms TTL=41
  
  telnet smtp.gmail.com 587
  Trying 173.194.200.109...
  Connected to smtp.gmail.com.
  Escape character is '^]'.
  </code></pre>
  
  <p>I have ruled out the following:
  I can ping the smtp.gmail.com which responds pretty fast.
  IMAP on gmail is already enabled. 
  I don't think it's the IDE, I tried both IDLE and VS Code and it's the same result. 
  I can also telnet to smtp.gmail.com on port 587 so firewall wise I am fine.
  It's also not a matter of running the IDE in admin mode either. 
  I have looked at the pydoc for smtplib and my command should work it seems. </p>
  
  <p>So I have no idea what is happening. Have any one seen this before?</p>
  
  <p>EDIT: I tried it on Python2 as well as and this behavior is the same.
  EDIT2: I ran a test using wireshark. I can see the 3way tcp handshake between me and the smtp mail server. But no communication after that. </p>