Problem configuring SMTP with GMAIL in my rails app

hello everybody…
i was trying configuring SMTP with GMail n my
rails appliaction. when running everything seems alright but the mails
not getting delivered. also the logs show the action as
successful .not much details are available from there…so plz help me
out… its a very simple system…i guess problem is with the
seeting…the setting which i am sing are.

ActionMailer::Base.server_settings = {
:address => “smtp.gmail.com”,
:port => 465,
:domain => “gmail.com”,
:authentication => :login,
:user_name => “username_of_gmail”,
:password => “password”,
}

plz help me out and point out the details…

thanxs in advance…

Gmail uses TSL (SSL), so you have to install a gem or a plugin to
support SSL (ActivMail doesn’t support it)

Please take a look at this post:

http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/83d06314b32896be/43423d12742f84db?lnk=gst&q=gmail#43423d12742f84db

Sorry but the thread seems to be broken…plz provide me with the
working one…
Meanwhile i have installed tsl plugin and installed it but still error
is there whereas the new setting are…
ActionMailer::Base.smtp_settings = {
:tls => true,
:address => “smtp.gmail.com”,
:port => “587”,
:domain => “MYDOMAIN”,
:authentication => :plain,
:user_name => “GOOGLEUSERNAME”,
:password => “GOOGLEPASSWORD”
}

and now the error prompts as

ArgumentError in EmailerController#sendmail
wrong number of arguments (7 for 6)

and appliaction trace is

#{RAILS_ROOT}/vendor/plugins/action_mailer_optional_tls/lib/
action_mailer_tls.rb:9:in start' #{RAILS_ROOT}/vendor/plugins/action_mailer_optional_tls/lib/ action_mailer_tls.rb:9:in perform_delivery_smtp’
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionmailer-1.3.3/lib/
action_mailer/base.rb:451:in send' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionmailer-1.3.3/lib/ action_mailer/base.rb:451:in deliver!’
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionmailer-1.3.3/lib/
action_mailer/base.rb:333:in method_missing' #{RAILS_ROOT}/app/controllers/emailer_controller.rb:12:in sendmail’

where as sensmail action seems alright as…

def sendmail
email = @params[“email”]
recipient = email[“recipient”]
subject = email[“subject”]
message = email[“message”]
Emailer.deliver_contact(recipient, subject, message)
return if request.xhr?
render :text => ‘Message sent successfully’
end

Plz help me out…seems some silly mistake…

On Feb 5, 5:19 pm, “[email protected][email protected]
wrote:

                    i was trying configuring SMTP with GMail n my

:authentication => :login,
:user_name => “username_of_gmail”,
:password => “password”,

}

plz help me out and point out the details…

thanxs in advance…

Got workin or not don’t know but error has changed now…

Timeout::Error in EmailerController#sendmail
execution expired

get rendered and also the mails does’nt get delived but in logs it
shows as delivered.

the application trace for the so is…

C:/InstantRails/ruby/lib/ruby/1.8/timeout.rb:54:in open' #{RAILS_ROOT}/vendor/plugins/action_mailer_optional_tls/lib/ smtp_tls.rb:35:indo_tls_start’
C:/InstantRails/ruby/lib/ruby/1.8/timeout.rb:56:in timeout' C:/InstantRails/ruby/lib/ruby/1.8/timeout.rb:76:intimeout’
#{RAILS_ROOT}/vendor/plugins/action_mailer_optional_tls/lib/
smtp_tls.rb:35:in do_tls_start' #{RAILS_ROOT}/vendor/plugins/action_mailer_optional_tls/lib/ smtp_tls.rb:18:insend’
#{RAILS_ROOT}/vendor/plugins/action_mailer_optional_tls/lib/
smtp_tls.rb:18:in start' #{RAILS_ROOT}/vendor/plugins/action_mailer_optional_tls/lib/ smtp_tls.rb:10:instart’
#{RAILS_ROOT}/vendor/plugins/action_mailer_optional_tls/lib/
action_mailer_tls.rb:9:in perform_delivery_smtp' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionmailer-1.3.3/lib/ action_mailer/base.rb:451:insend’
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionmailer-1.3.3/lib/
action_mailer/base.rb:451:in deliver!' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionmailer-1.3.3/lib/ action_mailer/base.rb:333:inmethod_missing’
#{RAILS_ROOT}/app/controllers/emailer_controller.rb:12:in `sendmail’

plz plz plz somebody help me out for an work around the problem…

thanks in advance…

Then, remove the plugin and try using the tlsmail gem:
http://www.wanlord.com/articles/2007/11/29/sending-email-using-actionmailer-and-gmail