Errors with actionmailer + gmail

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:

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”,
:port => 587,
:domain => ‘mydomain.com’,
:authentication => :plain,
:user_name => ‘[email protected]’,
: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:indo_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:instart’
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:inperform_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:indeliver!’
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.

?

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”,
:port => 587,
:domain => ‘mydomain.com’,
:authentication => :plain,
:user_name => ‘[email protected]’,
: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

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

regards
-Abhishek S.

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.

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

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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs