Talk:ActionMailer
From DreamHost
Comment: Hmmm... - according to the ActionMailer API docs, you're not supposed to have to specify server_settings for :sendmail, instead your configuration options are only :location and :arguments (sendmail has its own configuration). Why would you have to specify all those other settings for it to work?
Response: I'm not sure that this is a complete answer to your comment, but here is a snippet from "Agile Web Development With Rails" (p. 568) that might shed some light on the issue.
"The :sendmail setting delegates mail delivery to your local system's sendmail program, which is assumed to be in /usr/sbin. This delivery mechanism is not particularly portable, because sendmail is not always installed in this directory on different operating systems. It also relies on your local sendmail supporting the -i and -t command options."
Old versions of tips
I'm moving previous versions of these tips to this page as they do not work with rails 2.0.
To configure Action mailer to work with a dream host account add this configuration to your production.rb file.
# use ActionMailer::Base.smtp_settings for Rails 2.0
ActionMailer::Base.server_settings = {
:address => "mail.{yourdomain}.com",
:port => 25,
:domain => 'mail.{yourdomain}.com',
:user_name => "{email}@{yourdomain}.com",
:password => "{password}",
:authentication => :login
}
You can also use this when testing locally by adding this to your development.rb
The above didn't work for me...but this did:
ActionMailer::Base.delivery_method = :sendmail
ActionMailer::Base.server_settings = {
:address => 'mail.myniftydomain.com',
:port => 25,
:domain => 'myniftydomain.com',
:authentication => :plain,
:user_name => 'm0000000',
:password => 'password'
}
ActionMailer::Base.raise_delivery_errors = true
ActionMailer::Base.perform_deliveries = true
ActionMailer::Base.default_charset = 'utf-8'
Note: don't forget to include sub-domain in :address and :domain if applicable. Also set :user_name to the mailbox user code from dreamhost (i.e. m0000000) instead of the familiar name as this seems to be more reliable.

