我正在Linode上部署Rails應用程序。無法接收來自linode rails的電子郵件應用程序
這裏有點奇怪。我爲電子郵件設置了Gmail(例如,歡迎電子郵件)。如果我使用我的個人電子郵件註冊,我可以正確接收電子郵件。但是,如果我使用我公司的電子郵件進行註冊,我無法收到(即使在垃圾郵件中)。
我檢查了gmail帳戶(發送電子郵件)。事實證明,Gmail已正確發送所有電子郵件(我可以在發送郵件中看到所有電子郵件)。
然後我嘗試了一下本地機器的開發環境。我公司的電子郵件帳戶可以收到歡迎電子郵件。
它在我看來,1.促銷模式下的電子郵件設置是可以的。至少我的個人帳戶,例如Gmail,Hotmail可以收到歡迎郵件。 2.我公司的電子郵件服務器允許傳入的Gmail,因爲它在開發模式下工作。
不太確定爲什麼我公司的帳戶無法從linode上的生產模式下的Rails應用程序接收電子郵件。是否因爲電子郵件是從linode發送的,以便我公司的電子郵件服務器忽略來自這些IP地址的電子郵件?我以爲電子郵件是由gmail sever而不是linode發送的,理解是否正確?有沒有人可能會給我一些線索?
貼我production.rb
# Send deprecation notices to registered listeners
config.active_support.deprecation = :notify
config.action_mailer.default_url_options = { :host => 'xxxxx.com' }
#config.action_mailer.delivery_method = :smtp
config.action_mailer.raise_delivery_errors = false
config.action_mailer.perform_deliveries = true
#config.action_mailer.default :charset => "utf-8"
和environment.rb中
ActionMailer::Base.delivery_method = :smtp
ActionMailer::Base.smtp_settings =
{
:address => "smtp.gmail.com",
:port => 587,
:domain => "xxxxx.com",
:user_name => "[email protected]",
:password => "xxxxxx",
:authentication => :plain,
:enable_starttls_auto => true
}
你在你的config.rb文件中設置了域嗎? –