title: Python send email behind a proxy server
body: <p>I want to send an email using python script via hotmail smtp but I'm connected to a proxy server.</p>
  
  <p>There is my code , it works when it's connected directely to internet but wen it's connected to a proxy server he doesn't work.</p>
  
  <pre><code>import smtplib
  
  smtpserver = 'smtp.live.com'
  AUTHREQUIRED = 1 
  smtpuser = 'example@hotmail.fr'  
  smtppass = 'mypassword'  
  
  RECIPIENTS = 'mailto@gmail.com'
  SENDER = 'example@hotmail.fr'
  mssg = "test message"
  s = mssg   
  
  server = smtplib.SMTP(smtpserver,587)
  server.ehlo()
  server.starttls() 
  server.ehlo()
  server.login(smtpuser,smtppass)
  server.set_debuglevel(1)
  server.sendmail(SENDER, [RECIPIENTS], s)
  server.quit()
  </code></pre>