Translate →  
 
 
With Rails 2.1, there’s a little catch to getting the environment right for sending out emails. I’m guessing I’m the last to know since a Google search on the subject brought up nothing useful. So if you’re encountering errors from your 1.x Rails to 2.1 or the RailsSpace 13.1.1 tutorial or the Contact Form building web apps tutorial has got you spitting errors when rebooting the Mongrel (1.1.5 for me) server, this might be of some assistance.
ActionMailer::Base.delivery_method = :smtp
ActionMailer::Base.server_settings = {
:address => "smtpout.for_godaddy.com",
:port => "25",
:domain => "website.com",
:authentication => :login,
:user_name => "fullname@website.com",
:password => "1234abcd",
}
I received the following when rebooting the script/server Mongrel 1.1.5:
Exiting
c:/ruby/lib/ruby/gems/1.8/gems/actionmailer-
2.1.0/lib/action_mailer/base.rb:385:
in `method_missing’: undefined method `server_settings=’ for
ActionMailer::Base:Class (NoMethodError)
from
C:/play_space/rails_space/config/environments/development.rb:3
:in ‘load_environment’
Terrible, right? The list of errors is huge including numerous gems and custom_require messages. Two issues: The RailsSpace chapter 13 fails to put quotes around the EXPLICIT call of port 25. Note above =
Additionally, there’s a word change saving you TWO characters in your code: ActionMailer::Base.server_settings = {
Becomes: ActionMailer::Base.smtp_settings = {
See “server” change to “smtp” and put quotes around 25 IF you feel like being explicit which isn’t a bad idea. If you’re still having additional errors on Mongrel reboot, sorry. Check the report and attack the source if you can.
Thanks dude..
you sloved my big problem.. nice job
smiles :)
Comment by Willson on 686 days ago #
Thanks dude, you solved my problem too.
I had actually been having big Action Mailer problems since I upgraded to v2.0 and I wasn’t able to solve the problem then. Several months later, when I went to add a controller is when I got the error for ActionMailer which allowed me to find the answer on your site so your help actually help me solve both the ActionMailer problem of old and the error I was getting when creating a new controller…thanks again!
jackster
Comment by jackster on 657 days ago #
Thank you. This saved me quite a bit of time.
Comment by Krystyna Wisnaskas on 656 days ago #
thanks buddy your help.
Greate job friends
Comment by sisira on 445 days ago #
dude, thanks. Helped me out as well….
Comment by RubyNoobie on 441 days ago #