铁轨和不支持带有 -t 选项的 sendmail 收件人
我有一个开发环境文件,其中包含以下内容
config.action_mailer.delivery_method = :sendmail
config.action_mailer.sendmail_settings = {:arguments => '-i'}
我正在登录到已加载该环境的 Rails 控制台 我
class MyMailer < ActionMailer::Base
def test_email
mail(:to => '[email protected]',
:subject => 'test',
:from => '[email protected]')
end
end
MyMailer::test_email.deliver
并没有收到电子邮件,而是发现 Sendmail
sendmail: recipients with -t option not supported
实际上没有安装在这台计算机上,相反,我配置了 SSMTP ,按照 http://www.igvita.com/2007/08/29/ssmtp-relay-mail-delivery-in-rails/
当我发送时遇到同样的错误: smtp。所以在我看来,要么我的测试没有使用相同的环境变量,要么 Rails 简单地忽略了配置。
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 => '[email protected]',
:subject => 'test',
:from => '[email protected]')
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
环境加载程序被 /initializers/setup_mail.rb 中的其他值覆盖,因此 ActionMailer::Base 最终将使用错误的协议。
The environmental loader was being overwritten with other values from /initializers/setup_mail.rb, so ActionMailer::Base would end up using the wrong protocol.