title: How to send email using simple SMTP commands via Gmail?
body: <p>For educational purposes, I need to send an email through an SMTP server, using SMTP's fundamental and simple rules. </p>
  
  <p>I was able to do that using <a href="http://smtp4dev.codeplex.com/">smtp4dev</a>. I <code>telnet localhost 25</code> and and commands are:</p>
  
  <p><img src="https://i.stack.imgur.com/GkwJ5.png" alt="enter image description here"></p>
  
  <p>I want to do the same thing, using Gmail SMTP server. However, it requires authentication and TLS. I can't figure out how to do that for Gmail. Here's a screenshot of <code>telnet smtp.gmail.com 587</code>:</p>
  
  <p><img src="https://i.stack.imgur.com/pVLQf.png" alt="enter image description here"></p>
  
  <p>I searched and found many links including <a href="http://en.wikipedia.org/wiki/STARTTLS">Wikipedia's article</a> about <code>STARTTLS</code> command. But I'm not able to use TLS and authenticate to Gmail's SMTP server using command line (or sending commands myself in programming languages). Can anyone help?</p>