switch to new server broke rails 2.2.2 app email
Moving to a new server broke all of my mailers in a rails 2.2.2 app. To debug this i created the simplest test email possible and continue to get an error.
controller:
def send_new_password
@login = params[:login]
@user = User.find_by_login(@login)
UserMailer.deliver_new_password(@user) # line cited in the error msg
redirect_to login_path
end
user_mailer.rb:
class UserMailer < ActionMailer::Base
def new_password(user)
recipients user.email
from "service@ourdomain.com"
subject "New Password from ourdomain.com"
body "test test"
end
end
error msg:
wrong number of arguments (3 for 2)
vendor/plugins/action_mailer_tls/lib/smtp_tls.rb:8:in `check_auth_args'
vendor/plugins/action_mailer_tls/lib/smtp_tls.rb:8:in `do_start'
/System/L开发者_C百科ibrary/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/smtp.rb:525:in `start'
/Users/me/.rvm/gems/ruby-1.8.7-p334/gems/actionmailer-2.2.2/lib/action_mailer/base.rb:671:in `perform_delivery_smtp'
/Users/me/.rvm/gems/ruby-1.8.7-p334/gems/actionmailer-2.2.2/lib/action_mailer/base.rb:526:in `__send__'
/Users/me/.rvm/gems/ruby-1.8.7-p334/gems/actionmailer-2.2.2/lib/action_mailer/base.rb:526:in `deliver!'
/Users/me/.rvm/gems/ruby-1.8.7-p334/gems/actionmailer-2.2.2/lib/action_mailer/base.rb:392:in `method_missing'
app/controllers/home_controller.rb:87:in `send_new_password'
environment.rb:
ActionMailer::Base.smtp_settings = {
:address => "smtp.ourmailserver.com",
:port => 25,
:domain => "ourmailserver.com",
:authentication => :plain,
:user_name => "service@ourdomain.com",
:password => "ourpassword"
}
version information:
- ruby 1.8.7 (same as prior server)
- rubygems version 1.3.6 (same as prior server)
- rails 2.2.2 (same as prior server)
- all gems are the same version as the prior server
- environment.rb, production, development and test configuration files are all exactly the same
精彩评论