我有一个具有以下设置的 ActionMailer(根据本指南):
require 'digest/sha2'
class WinnerMailer < ActionMailer::Base
include Resque::Mailer
default "Message-ID"=>"<#{Digest::SHA2.hexdigest(Time.now.to_i.to_s)}@my-domain.com>"
default from: "mail@my-domain.com"
我的电子邮件有:
From: mail@my-domain.com
To: xxx@gmail.com
Message-Id: <50117ee0355959752a01b1737c8568f30ea72db2f35ec68cfa7808cea18dbb69@my-domain.com>
我的production.rb
有以下设置:
config.action_mailer.delivery_method = :smtp
config.action_mailer.perform_deliveries = :true #try to force sending in development
config.action_mailer.raise_delivery_errors = :false
config.action_mailer.smtp_settings = {
:authentication => :plain,
:address => "smtp.mailgun.org",
:port => 587,
:domain => "my-domain.com",
:user_name => "postmaster@my-domain.com",
:password => "qqqqq"
}
由于某些原因,我所有的信件都进入了垃圾邮件文件夹。我究竟做错了什么?