# Errors with actionmailer + gmail

**URL:** <https://www.ruby-forum.com/t/errors-with-actionmailer-gmail/175050>\
**Category:** Rails\
**Created:** [September 7, 2009, 2:56am UTC](https://www.ruby-forum.com/t/errors-with-actionmailer-gmail/175050 "2009-09-07T02:56:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![softf5ajivanet](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/9f8e36/32.png) [@softf5ajivanet](https://www.ruby-forum.com/u/softf5ajivanet)\
**Post date:** [September 7, 2009, 2:56am UTC](https://www.ruby-forum.com/t/errors-with-actionmailer-gmail/175050/1 "2009-09-07T02:56:53Z")

</div>

trying to get a rails app to work with Gmail under ruby 1.8.6, but  
getting some weird errors, any help really appreciated.

Basically I installed the openrain-tls gem from here:

> **[GitHub - openrain/action\_mailer\_tls: Gmail and ActionMailer](https://github.com/openrain/action_mailer_tls/tree/master)**
>
> master

then added my settings to : smtp\_gmail.rb

* * *

require “smtp\_tls”

ActionMailer::Base.raise\_delivery\_errors = true  
ActionMailer::Base.delivery\_method = :smtp  
ActionMailer::Base.smtp\_settings = {  
:enable\_starttls\_auto =\> true,  
:address =\> “[smtp.gmail.com](http://smtp.gmail.com)”,  
:port =\> 587,  
:domain =\> ‘[mydomain.com](http://mydomain.com)’,  
:authentication =\> :plain,  
:user\_name =\> ‘removed\_email\_address@domain.invalid’,  
:password =\> ‘password’  
}

tried it out in script/console and got:

Loading development environment (Rails 2.3.2)

> > Notifier.deliver\_hello\_world  
> > ArgumentError: wrong number of arguments (3 for 2)  
> > from  
> > /Users/johngriffiths/Repos/bitbucket/dates/vendor/plugins/action\_mailer\_optional\_tls/lib/smtp\_tls.rb:33:in  
> > `check_auth_args' from /Users/johngriffiths/Repos/bitbucket/dates/vendor/plugins/action_mailer_optional_tls/lib/smtp_tls.rb:33:in `do\_tls\_start’  
> > from  
> > /Users/johngriffiths/Repos/bitbucket/dates/vendor/plugins/action\_mailer\_optional\_tls/lib/smtp\_tls.rb:18:in  
> > `send' from /Users/johngriffiths/Repos/bitbucket/dates/vendor/plugins/action_mailer_optional_tls/lib/smtp_tls.rb:18:in `start’  
> > from  
> > /Users/johngriffiths/Repos/bitbucket/dates/vendor/plugins/action\_mailer\_optional\_tls/lib/smtp\_tls.rb:10:in  
> > `start' from /Users/johngriffiths/Repos/bitbucket/dates/vendor/plugins/action_mailer_optional_tls/lib/action_mailer_tls.rb:9:in `perform\_delivery\_smtp’  
> > from  
> > /Library/Ruby/Gems/1.8/gems/actionmailer-2.3.2/lib/action\_mailer/base.rb:523:in  
> > ` __send__' from /Library/Ruby/Gems/1.8/gems/actionmailer-2.3.2/lib/action_mailer/base.rb:523:in `deliver!’  
> > from  
> > /Library/Ruby/Gems/1.8/gems/actionmailer-2.3.2/lib/action\_mailer/base.rb:395:in  
> > `method\_missing’  
> > from (irb):1

any ideas?

would really love to know where i’m going wrong, basically followed his  
example below to the letter, don’t know where i’ve gone wrong.

> **[GitHub - openrain/action\_mailer\_tls: Gmail and ActionMailer](https://github.com/openrain/action_mailer_tls/tree/master)**
>
> master

?

---

<div class="post-metadata">

**Author:** ![softf5ajivanet](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/9f8e36/32.png) [@softf5ajivanet](https://www.ruby-forum.com/u/softf5ajivanet)\
**Post date:** [September 7, 2009, 1:36pm UTC](https://www.ruby-forum.com/t/errors-with-actionmailer-gmail/175050/2 "2009-09-07T13:36:54Z")

</div>

John G. wrote:

> trying to get a rails app to work with Gmail under ruby 1.8.6, but  
> getting some weird errors, any help really appreciated.

> then added my settings to : smtp\_gmail.rb
> 
> * * *
> 
> require “smtp\_tls”
> 
> ActionMailer::Base.raise\_delivery\_errors = true  
> ActionMailer::Base.delivery\_method = :smtp  
> ActionMailer::Base.smtp\_settings = {  
> :enable\_starttls\_auto =\> true,  
> :address =\> “[smtp.gmail.com](http://smtp.gmail.com)”,  
> :port =\> 587,  
> :domain =\> ‘[mydomain.com](http://mydomain.com)’,  
> :authentication =\> :plain,  
> :user\_name =\> ‘removed\_email\_address@domain.invalid’,  
> :password =\> ‘password’  
> }

> any ideas?
> 
> would really love to know where i’m going wrong, basically followed his  
> example below to the letter, don’t know where i’ve gone wrong.

hi John

better you switch to ruby 1.8.7 as Ruby 1.8.7 supports SMTP TLS.  
[https://rails.lighthouseapp.com/projects/8994/tickets/1336-starttls-for-smtp-makes-gmail-go](https://rails.lighthouseapp.com/projects/8994/tickets/1336-starttls-for-smtp-makes-gmail-go)

I will not suggess install a plugin (in 1.8.6) for something that was  
fixed, trialled, and used in later versions.

anyway for ruby 1.8.6 you can try this one:  
[https://projects.littlestreamsoftware.com/projects/83/wiki/Actionmailer?version=8](https://projects.littlestreamsoftware.com/projects/83/wiki/Actionmailer?version=8)

regards  
-Abhishek S.

---

<div class="post-metadata">

**Author:** ![softf5ajivanet](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/9f8e36/32.png) [@softf5ajivanet](https://www.ruby-forum.com/u/softf5ajivanet)\
**Post date:** [September 7, 2009, 1:49pm UTC](https://www.ruby-forum.com/t/errors-with-actionmailer-gmail/175050/3 "2009-09-07T13:49:45Z")

</div>

thanks for the post, if i could upgrade the box to 1.8.7 i surely would.

i’ll try out that link and see how it goes, appreciate it.

---

<div class="post-metadata">

**Author:** ![softf5ajivanet](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/9f8e36/32.png) [@softf5ajivanet](https://www.ruby-forum.com/u/softf5ajivanet)\
**Post date:** [September 7, 2009, 8:45pm UTC](https://www.ruby-forum.com/t/errors-with-actionmailer-gmail/175050/4 "2009-09-07T20:45:28Z")

</div>

got it working in the end, managed to find a copy of smtp-tls in github,  
forked and wiki’d the how-to

[http://wiki.github.com/johnantoni/smtp-tls/how-to-for-rails-232-ruby-186](http://wiki.github.com/johnantoni/smtp-tls/how-to-for-rails-232-ruby-186)

should help anyone else in the same position, works like a dream!
