2

Rails 3.2 と ActionMailer を使用して電子メール通知を送信しています。

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 receiver@domain.com (1497ms)
Date: Wed, 10 Apr 2013 11:31:44 +0200
From: support@my_domain.com
To: joel.maranhao@gmail.com
Message-ID: <516531804e7a_8a23fbfc5c34ec4299fa@joel-maranhaos-imac.local.mail>
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: <5165317fe1356_8a23fbfc5c34ec4297a6@joel-maranhaos-imac.local.mail>

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: <5165317ff08e6_8a23fbfc5c34ec4298f2@joel-maranhaos-imac.local.mail>

<!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)

これに取り組む方法についてのアイデアはありますか?Gmailアカウントで動作するため、EOF(ファイルの終わりに達した)が何を伝えているのかわかりません。

4

1 に答える 1

-1

support@yourwebsite.com のような GoDaddy 登録メール アカウントを提供するか、MY_USERNAME がメールの場合は、送信者アドレスとして MY_USERNAME を提供します。それは私のために働きました.それがあなたのために働くことを願っています.

于 2015-03-24T09:10:05.613 に答える