0
我有以下設置的ActionMailer(根據this指南):Ruby on Rails的郵件+ Mailgun標記爲垃圾郵件
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: "[email protected]"
我的電子郵件地址有:
From: [email protected]
To: [email protected]
Message-Id: <5[email protected]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 => "[email protected]",
:password => "qqqqq"
}
由於某些原因,我的所有信件都進入了垃圾郵件文件夾。我究竟做錯了什麼?
您是否發送電子郵件:from:mail @ my-domain.com? – alexsmn
@ uhn-nohn我不確定你的意思,但我認爲是。我有一個域名(當然不是my-domain.com),我的網站在那裏。 – user2786037
我爲什麼這麼問。有可能你的郵件被髮送到垃圾郵件,因爲你的域名是'my-domain.com',發件人又是'mail @ my-domain.com'。您是否嘗試使用Gmail帳戶發送郵件? – alexsmn