2013-04-10 68 views
2

我正在使用Rails 3.2和ActionMailer發送電子郵件通知。ActionMailer意外的EOFError

我已經在GoDaddy購買了電子郵件。

我也在用Gmail帳戶進行測試。

在我development.rb我使用Gmail時通常配置電子郵件這種方式佔

# config.action_mailer.smtp_settings = { 
    #   :enable_starttls_auto => true, 
    #   :address => "smtp.gmail.com", 
    #   :port => "587", 
    #   :domain => "google.com", 
    #   :authentication => :plain, 
    #   :user_name => "MY_USER_NAME", 
    #   :password => "MY_PASSWORD" 
    # } 

使用Gmail一切工作正常,並在任何時候都沒有問題。

現在,當我配置我的GoDaddy的帳戶,我,現在,然後,得到一個EOF Error消息沒有更多的信息

config.action_mailer.smtp_settings = { 
      #:enable_starttls_auto => true, 
      :address => "smtpout.europe.secureserver.net", 
      :port => 80, 
      :domain => "MY_DOMAIN.COM", 
      :authentication => :plain, 
      :user_name => "MY_USERNAME", 
      :password => "MY_PASSWORD" 
    } 

我的問題是,它的實際工作,但有時,和我不不知道爲什麼,它給我一個EOF錯誤信息失敗。

從控制檯

... 

    Rendered user_mailer/service_notification_email.html.erb (44.6ms) 
    Rendered user_mailer/service_notification_email.text.erb (0.4ms) 

Sent mail to [email protected] (1497ms) 
Date: Wed, 10 Apr 2013 11:31:44 +0200 
From: [email protected]_domain.com 
To: [email protected] 
Message-ID: <[email protected]> 
Subject: My application notification - Testing 
Mime-Version: 1.0 
Content-Type: multipart/alternative; 
boundary="--==_mimepart_5165317fc70c3_8a23fbfc5c34ec429616"; 
charset=UTF-8 
Content-Transfer-Encoding: 7bit 



----==_mimepart_5165317fc70c3_8a23fbfc5c34ec429616 
Date: Wed, 10 Apr 2013 11:31:43 +0200 
Mime-Version: 1.0 
Content-Type: text/plain; 
charset=UTF-8 
Content-Transfer-Encoding: 7bit 
Content-ID: <[email protected]l> 

Service notification 
=======================================  

Testing 

hello 

New service created 

----==_mimepart_5165317fc70c3_8a23fbfc5c34ec429616 
Date: Wed, 10 Apr 2013 11:31:43 +0200 
Mime-Version: 1.0 
Content-Type: text/html; 
charset=UTF-8 
Content-Transfer-Encoding: 7bit 
Content-ID: <5165317f[email protected]> 

<!DOCTYPE html> 
<html> 
    <head> 
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /> 
    <link href='http://twitter.github.com/bootstrap/assets/css/bootstrap.css' rel='stylesheet' /> 
    </head> 
    <body> 
    <div class="container"> 

    <h1>Testing by Buyer</h1> 

    <p>hello</p> 

    <h2>Notice</h2> 
    <p>New service created</p> 
    </div> 
    </body> 
</html> 

----==_mimepart_5165317fc70c3_8a23fbfc5c34ec429616-- 

    (0.3ms) ROLLBACK 
Completed 500 Internal Server Error in 3282ms 

EOFError (end of file reached): 
    app/models/creative_service.rb:49:in `new_service' 
    app/controllers/creative_services_controller.rb:80:in `block in create' 
    app/controllers/creative_services_controller.rb:79:in `create' 
    config/initializers/quiet_assets.rb:7:in `call_with_quiet_assets' 


    Rendered /Users/joel/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.2.11/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.5ms) 
    Rendered /Users/joel/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.2.11/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (1.1ms) 
    Rendered /Users/joel/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.2.11/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (13.8ms) 

關於如何解決這個任何想法的錯誤日誌? 我不確定EOF(到達文件的末尾)告訴我什麼,因爲它適用於Gmail帳戶。

+1

遇到同樣的問題。我能夠發送郵件很好,現在不再那麼做了。我已閱讀,我們需要一些SPF記錄添加到您的DNS記錄的地方,但我不知道這確實會解決這個問題。 – 2014-01-10 08:56:32

+4

我投票關閉這一問題作爲題外話,因爲我們不是客戶GoDaddy的 – Tunaki 2016-08-24 15:18:08

+0

傢伙的支持,你可以這麼狹隘。仍然選擇一個3歲的問題:D關閉該死的問題!但留下小意見 – zabumba 2016-09-07 10:33:47

回答

-1

給GoDaddy的註冊電子郵件帳戶像[email protected]或者MY_USERNAME是電子郵件,然後給MY_USERNAME爲UR發件人地址。 它爲我工作。希望它適用於你。

+0

現在看來,這個答案實在不清楚。 – JAL 2016-08-24 15:19:30

+0

,如果你使用不同的電子郵件SMTP設置和發件人mail.Please檢查過你可能會得到這個連。爲smtp設置指定相同的郵件並從中發送。 – 2016-08-24 17:27:18