2

我设置了actionmailer。电子邮件没有被发送,也没有错误。

我在哪里可以开始搜索来调试这个?

class Notifier < ActionMailer::Base

default_url_options[:host] = APP_DOMAIN

def email_blast(user, subject, message)
subject subject
from NOTIFIER_EMAIL
recipients user.email
sent_on Time.zone.now
body :user => user.first_name + ' ' + user.last_name, :message => message
end

我确实在我的日志中收到了电子邮件已发送的回复,只是没有实际的电子邮件通过。

还有一个原因,这不起作用是因为我从集群切换到一个单独的盒子,并且一些服务器设置被覆盖了。我怀疑这可能是这不起作用的原因。任何人都知道我必须查看哪些特定的服务器设置?

更新:

ActionMailer::Base.delivery_method = :sendmail
config.action_mailer.default_url_options = { :host => "75.101.153.93" }

我在我的 production.rb 中找到了这个。这段代码在它工作时最初是在这里的。再一次,我相信我的服务器上一定有什么东西丢失了。我做了一个'which sendmail',它返回了 /usr/bin/sendmail ,所以我添加了这个:

config.action_mailer.raise_delivery_errors = false
config.action_mailer.perform_deliveries = true
config.action_mailer.sendmail_settings = {
 :location        => '/usr/bin/sendmail',
 :arguments       => '-i -t'
}

重新部署,重新启动服务器,并对其进行测试。没有发送电子邮件。

production.log 说发送了一些东西:

Processing MediaController#create_a_video (for 173.161.167.41 at 2010-06-03 11:58:13) [GET]
  Parameters: {"action"=>"create_a_video", "controller"=>"media", "organization_id"=>"470",     "_"=>"1275591493194"}
Sent mail to info@hqchannel.com
Rendering media/create_a_video
Completed in 128ms (View: 51, DB: 1) | 200 OK [http://invent.hqchannel.com/organizations/470/media/create_a_video?_=1275591493194]
4

0 回答 0