Problem sending emails with the latest Rails at SliceHost and DreamHost

Back to Home Page...

2 March, 2009

Tag : Code : Ruby on Rails

After upgrading my base application to Rails 2.2.2 I have notice 2 little things blocking me from sending emails while in production environment.

For some reason I started to get a “NameError uninitialized constant” error on my production log.

To fix this first error I had to include the “ActionMailer” on my application controller. ( I send emails from several different controllers on my base APP )

The other error was about the rails now asking you to have SSL in order to send emails. ( OpenSSL::SSL::SSLError (hostname was not match with the server certificate) )

To fix the second error I had to first freeze the rails gems “rake rails:freeze:gems”, to have a copy of rails 2.2.2 under my vendor dir, then comment the following line at “rails_root/vendor/rails/actionmailer/lib/action_mailer/base.rb”

As soon as you comment out the line above your app should be ready to send emails.

1 comment posted

26 March, 2009

By: David Hughes

Thanks for the help – just ran into this problem today. For future readers, the line in base.rb is 670.

Cheers,
David

His or Her website: click here...

Click here to post your comment...