Rails & sendmail recipients with -t option not supported
I have a development environment file that contains the following
config.action_mailer.delivery_method = :sendmail
config.action_mailer.sendmail_settings = {:arguments => '-i'}
I'm logging into the rails console with that environment loaded up
class MyMailer < ActionMailer::Base
def test_email
mail(:to => 'somebodyelse@somewhere.com',
:subject => 'test',开发者_如何学运维
:from => 'somebody@somewhere.com')
end
end
MyMailer::test_email.deliver
And instead of getting that email delivered, I get this
sendmail: recipients with -t option not supported
Sendmail is actually not installed on this machine, instead, I've configured SSMTP, following the instructions at http://www.igvita.com/2007/08/29/ssmtp-relay-mail-delivery-in-rails/
I get the same error when I'm sending by :smtp. So it looks to me like either my test is not using the same environment variable or Rails simply ignore the configuration.
The environmental loader was being overwritten with other values from /initializers/setup_mail.rb, so ActionMailer::Base would end up using the wrong protocol.
精彩评论