# Problem configuring SMTP with GMAIL in my rails app

**URL:** <https://www.ruby-forum.com/t/problem-configuring-smtp-with-gmail-in-my-rails-app/128147>\
**Category:** Rails\
**Created:** [February 5, 2008, 11:55am UTC](https://www.ruby-forum.com/t/problem-configuring-smtp-with-gmail-in-my-rails-app/128147 "2008-02-05T11:55:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![envynicky](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/7ab992/32.png) [@envynicky](https://www.ruby-forum.com/u/envynicky)\
**Post date:** [February 5, 2008, 11:55am UTC](https://www.ruby-forum.com/t/problem-configuring-smtp-with-gmail-in-my-rails-app/128147/1 "2008-02-05T11:55:31Z")

</div>

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](http://smtp.gmail.com)”,  
:port =\> 465,  
:domain =\> “[gmail.com](http://gmail.com)”,  
:authentication =\> :login,  
:user\_name =\> “username\_of\_gmail”,  
:password =\> “password”,  
}

plz help me out and point out the details…

thanxs in advance…

---

<div class="post-metadata">

**Author:** ![envynicky](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/7ab992/32.png) [@envynicky](https://www.ruby-forum.com/u/envynicky)\
**Post date:** [February 5, 2008, 1:19pm UTC](https://www.ruby-forum.com/t/problem-configuring-smtp-with-gmail-in-my-rails-app/128147/2 "2008-02-05T13:19:47Z")

</div>

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](http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/83d06314b32896be/43423d12742f84db?lnk=gst&q=gmail#43423d12742f84db)

---

<div class="post-metadata">

**Author:** ![envynicky](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/7ab992/32.png) [@envynicky](https://www.ruby-forum.com/u/envynicky)\
**Post date:** [February 5, 2008, 1:59pm UTC](https://www.ruby-forum.com/t/problem-configuring-smtp-with-gmail-in-my-rails-app/128147/3 "2008-02-05T13:59:22Z")

</div>

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](http://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, “removed\_email\_address@domain.invalid” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
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…

---

<div class="post-metadata">

**Author:** ![envynicky](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/7ab992/32.png) [@envynicky](https://www.ruby-forum.com/u/envynicky)\
**Post date:** [February 5, 2008, 3:17pm UTC](https://www.ruby-forum.com/t/problem-configuring-smtp-with-gmail-in-my-rails-app/128147/4 "2008-02-05T15:17:13Z")

</div>

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:in`do\_tls\_start’  
C:/InstantRails/ruby/lib/ruby/1.8/timeout.rb:56:in `timeout' C:/InstantRails/ruby/lib/ruby/1.8/timeout.rb:76:in`timeout’  
#{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:in`send’  
#{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: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’

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

thanks in advance…

---

<div class="post-metadata">

**Author:** ![envynicky](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/7ab992/32.png) [@envynicky](https://www.ruby-forum.com/u/envynicky)\
**Post date:** [February 7, 2008, 1:56pm UTC](https://www.ruby-forum.com/t/problem-configuring-smtp-with-gmail-in-my-rails-app/128147/5 "2008-02-07T13:56:24Z")

</div>

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