2011-09-17 50 views
1

我的prod actionmailer有問題。我在site5共享雲上託管。問題是我得到這個錯誤信息。Rails 3 ActionMailer - 沒有配方地址

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: [email protected] 
To: [email protected] 
Message-ID: <[email protected]> 
Subject: test 
Mime-Version: 1.0 
Content-Type: text/plain; 
charset=UTF-8 
Content-Transfer-Encoding: 7bit 

我增加了默認的

default :recipient => '[email protected]' 

但寄回我同樣的錯誤。

我的ActionMailer控制器

class Emailtousers < ActionMailer::Base 
    default :from => "[email protected]" 
    default :recipient => "[email protected]" 
    def plan_notification(resource) 
    @resource = resource 
    puts resource 
    mail(:to => "[email protected]", :subject => 'test') 
    end 
end 

我錯過了什麼?

我遵循了這一幫我http://edgeguides.rubyonrails.org/action_mailer_basics.html

+0

請收件人是該域之外的嘗試,讓我們知道你會得到什麼 – jschorr

+0

收件人是:郵件?我已經嘗試過使用另一個域名和另一封電子郵件,並且默認獲取相同的郵件..沒有收件人郵件。謝謝 – neimad

+0

是的,收件人是獲得電子郵件的人。 – jschorr

回答

6

我用這個問題:有進出口sendmail的交付方法。增加這配置/ application.rb中固定對我來說:

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

我找到了解決辦法,在https://github.com/mikel/mail/issues/70#issuecomment-2639987

+0

謝謝,我解決了這個問題..問題出現在服務器端。郵件設置不正確。但感謝您的修復。我會用我的下一個rails projets來試試它。 – neimad

+0

@neimad你能分享一下你在這個問題上找到的解決方案嗎? – Robin

+0

@neimad:是的,拜託,正如羅賓所說......我也只能用史蒂夫的解決方案來解決這個問題,並且覺得很困惑。 –