title: Why am I getting Net::SMTPSyntaxError?
body: <p>I am trying to set up a Sinatra based Ruby app to connect to Gmail and send emails through SMTP. I followed the instructions I found on the web, but I always get this error:</p>
  
  <blockquote>
    <p>Net::SMTPSyntaxError at /contact 502
    5.5.1 Unrecognized command. k30sm7454901vbl.19</p>
  
  <pre><code>* file: smtp.rb
  * location: check_response
  * line: 930
  </code></pre>
  </blockquote>
  
  <p>It's being raised from a core Ruby file</p>
  
  <p>/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/smtp.rb in check_response  </p>
  
  <p>...and here is the method in which it happens:</p>
  
  <pre><code>def check_response(res)
   unless res.success?
  
      raise res.exception_class, res.message
  
   end
  end 
  </code></pre>
  
  <p>Can anyone tell me why this is happening and what I am doing wrong?</p>
  
  <p>Thanks in advance!</p>