【问题标题】:Rails 3 ActionMailer - no recipent addressRails 3 ActionMailer - 没有recipent地址
【发布时间】:2012-07-20 02:55:52
【问题描述】:

我的 prod actionmailer 有问题。我托管在 site5 共享云上。问题是我收到此错误消息。

A message that you sent using the -t command line option contained no
addresses that were not also on the command line, and were therefore
suppressed. This left no recipient addresses, and so no delivery could
be attempted.

------ This is a copy of your message, including all the headers. ------

Date: Sat, 17 Sep 2011 21:06:42 +0000
From: noreply@mydomain.com
To: myemail@mydomain.com
Message-ID: <4e750be27b3ef_4a9c159402ee91b039763@themailserver.com>
Subject: test
Mime-Version: 1.0
Content-Type: text/plain;
charset=UTF-8
Content-Transfer-Encoding: 7bit

我添加了默认

default :recipient => 'noreply@mydomain.com'

但是邮件返回给我同样的错误。

我的 ActionMailer 控制器

class Emailtousers < ActionMailer::Base
  default :from => "noreply@mydomain.com"
  default :recipient => "noreplay@mydomain.com"
  def plan_notification(resource)
    @resource = resource
    puts resource
    mail(:to => "myemail@mydomain.com", :subject => 'test')
  end
end

我错过了什么?

我跟着这个来帮助我http://edgeguides.rubyonrails.org/action_mailer_basics.html

【问题讨论】:

  • 请与该域外的收件人一起尝试,并告诉我们您会收到什么
  • 收件人是收件人:邮件?我已经尝试过使用另一个域和另一封电子邮件,并且默认来自获取相同的邮件.. 没有收件人消息。谢谢
  • 是的,收件人是收到电子邮件的人。
  • 好的,我得到了同样的东西!我的主机告诉我更改身份验证 => :login 为 :plain,但同样的事情!

标签: ruby-on-rails ruby-on-rails-3 actionmailer


【解决方案1】:

我在使用带有 exim 的 :sendmail 传递方法时遇到了这个问题。将此添加到 config/application.rb 为我修复了它:

config.action_mailer.sendmail_settings = { :arguments => "-i" }

我在https://github.com/mikel/mail/issues/70#issuecomment-2639987找到了解决方案

【讨论】:

  • 谢谢,我解决了这个问题..问题出在服务器端。邮件设置不正确。但感谢这个修复。我将在我的下一个 Rails 项目中尝试一下。
  • @neimad 你能分享一下你为这个问题找到的解决方案吗?
  • @neimad:是的,拜托,就像 Robin 说的那样……我也只能用 Steve 的解决方案来解决这个问题,我很困惑为什么。
猜你喜欢
  • 2011-06-24
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-07-22
  • 1970-01-01
  • 2013-04-09
  • 2011-11-29
相关资源
最近更新 更多