title: how to use Python to send email without exposing password?
body: <p>This snippet works but the password in the code is wide open:</p>
  
  <pre><code>import smtplib
  server = smtplib.SMTP('smtp.gmail.com', 587)
  server.ehlo()
  server.starttls()
  server.ehlo()
  server.login("usrname", "pw")
  
  msg = "\nHello!" # The /n separates the message from the headers
  server.sendmail("me@gmail.com", "u@gmail.com", msg)
  server.quit()
  </code></pre>
  
  <p>I'm wondering how to do this securely. </p>
  
  <p>edit:</p>
  
  <p>I'm looking for "keystorage" solutions, like one used by any real email client, which stores your password securely (hopefully) on the disk.</p>