views:

25

answers:

1

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:

Net::SMTPSyntaxError at /contact 502 5.5.1 Unrecognized command. k30sm7454901vbl.19

* file: smtp.rb
* location: check_response
* line: 930

It's being raised from a core Ruby file

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/smtp.rb in check_response

...and here is the method in which it happens:

def check_response(res)
 unless res.success?

    raise res.exception_class, res.message

 end
end 

Can anyone tell me why this is happening and what I am doing wrong?

Thanks in advance!

A: 

This post might be helpful, where the author states that Google's SMTP demands the use of TLS which ruby's SMTP lib doesn't support out of the box. There's also a stackoverflow answer.

Kitto