Ruby 1.9, gmail and NET::SMTP
- by anshul
I am running ruby 1.9.1p243 (2009-07-16 revision 24175) [x86_64-linux].
require 'mail'
options = {
:address => "smtp.gmail.com",
:port => 587,
:domain => 'REMOVED',
:user_name => 'REMOVED',
:password => 'REMOVED',
:authentication => 'plain',
:enable_starttls_auto => true }
Mail.defaults do
delivery_method :smtp, options
end
Mail.deliver do
to 'REMOVED'
from 'REMOVED'
subject 'Testing'
body 'Test body'
end
results in the error
Net::SMTPAuthenticationError: 530 5.7.0 Must issue a STARTTLS command first. x.REMOVED!
What am I doing wrong and how do I fix it?