Does anyone have any quality (and up-to-date) information regarding sending mail via Gmail using Ruby\'s Net::SMTP? I\'ve seen several examples -- most dating from 2007 to
Are you connecting to smtp.gmail.com port 465 I am assuming? .
openssl s_client -connect smtp.gmail.com:587
CONNECTED(00000003) 8298:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:s23_clnt.c:601:
The error looks very similar to yours. The following command does work:
openssl s_client -starttls smtp -connect smtp.gmail.com:587
So I think what is happening is that you do not have STARTTLS support enabled. I am not sure how to do it in ruby buy what I did find out is that the action_mailer_tls plugin allows this by patching Net::SMTP. As of Ruby 1.8.7, Net::SMTP has this support built-in.
If you are using Ruby < 1.8.7 here is the patch.