0

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/Library/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:

  1. ruby 1.8.7 (same as prior server)
  2. rubygems version 1.3.6 (same as prior server)
  3. rails 2.2.2 (same as prior server)
  4. all gems are the same version as the prior server
  5. environment.rb, production, development and test configuration files are all exactly the same
Jay
  • 6,206
  • 11
  • 48
  • 82
  • Might be useful to know what line the error message relates to? – Yule Sep 09 '11 at 13:19
  • what's the config of your previous server ? – Awea Sep 09 '11 at 13:24
  • @Yule, thanks. See the line that is now indicated in the controller portion of the post. – Jay Sep 09 '11 at 14:35
  • @Awea, if you mean the smtp settings, they are the exact same as the previous server. If you mean the environment.rb and development, production and test environments... exactly the same. Both servers utilized Apache2 with passenger. Is there something else you want to know? – Jay Sep 09 '11 at 14:38

0 Answers0