title: Python sending email too slow
body: <p>I have the script below which I'm using to send say 10 messages myself&lt;->myself. However, I've noticed that Python really takes a while to do that. Last year I needed a system to send about 200 emails with attachments and text and I implemented it with msmtp + bash. As far as I remember it was much faster.</p>
  
  <p>Moving the while loop inside (around the smtp_serv.sendmail(sender, recepient, msg) function yields similar results).</p>
  
  <p>Am I doing something wrong? Surely it can't be slower than bash + msmtp (and I'm only sending a 'hi' message, no attachments).</p>
  
  <pre><code>#! /usr/bin/python3.1
  
  def sendmail(recepient,  msg):
  
      import smtplib
  
      # Parameters
      sender = 'login@gmail.com'
      password = 'password'
      smtpStr = 'smtp.gmail.com'
      smtpPort = 587
      # /Parameters
  
      smtp_serv = smtplib.SMTP(smtpStr, smtpPort)
      smtp_serv.ehlo_or_helo_if_needed()
      smtp_serv.starttls()
      smtp_serv.ehlo()
  
      recepientExists = smtp_serv.verify(recepient)
      if recepientExists[0] == 250:
          smtp_serv.login(sender, password)
          try:
              smtp_serv.sendmail(sender, recepient, msg)
          except smtplib.SMTPException:
              print(recepientExists[1])
      else:
          print('Error',   recepientExists[0], ':',  recepientExists[1])
  
      smtp_serv.quit()
  
  for in in range(10):
      sendmail('receiver@gmail.com',  'hi')
  </code></pre>