【问题标题】:rails 3.1, Why I can't send email using ActionMailer?rails 3.1,为什么我不能使用 ActionMailer 发送电子邮件?
【发布时间】:2012-03-21 21:28:43
【问题描述】:

我的 heroku 应用程序有问题,我正在尝试使用我的 Godaddy 电子邮件帐户发送电子邮件,这是我在 environment/production.rb 中的设置:

  config.active_support.deprecation = :notify

  config.action_mailer.default_url_options = { :host => 'coursebuilder2.heroku.com' }

  config.action_mailer.delivery_method = :smtp

  ActionMailer::Base.smtp_settings = {
    :address  => "smtpout.secureserver.net",
    :port  => 25,
    :user_name  => "myemail@domain.com",
    :password  => "password",
    :authentication  => :login
  }

  config.action_mailer.raise_delivery_errors = true

但是,这是我得到的:

Rendered instructors/mailer/confirmation_instructions.html.erb (1.1ms)
Completed 500 Internal Server Error in 666ms

SocketError (getaddrinfo: Name or service not known):

cache: [POST /instructors] invalidate, pass

那么,我在这里缺少什么?

编辑

我已经修复了上面的设置,但是现在我在下面出现了超时错误:

2012-03-04T04:44:20+00:00 app[web.1]: Rendered instructors/mailer/confirmation_instructions.html.erb (0.4ms)
2012-03-04T04:44:50+00:00 heroku[router]: Error H12 (Request timeout) -> POST coursebuilder2.herokuapp.com/instructors dyno=web.1 queue= wait= service=30000ms status=503 bytes=0
2012-03-04T04:45:20+00:00 app[web.1]: Completed 500 Internal Server Error in 60414ms
2012-03-04T04:45:20+00:00 app[web.1]: 
2012-03-04T04:45:20+00:00 app[web.1]:   
2012-03-04T04:45:20+00:00 app[web.1]: Timeout::Error (Timeout::Error):
2012-03-04T04:45:20+00:00 app[web.1]: 
2012-03-04T04:45:20+00:00 app[web.1]: 
2012-03-04T04:45:20+00:00 app[web.1]: cache: [POST /instructors] invalidate, pass

谁能给点建议?

【问题讨论】:

    标签: ruby-on-rails-3 heroku actionmailer


    【解决方案1】:

    您似乎使用了错误的 GoDaddy 连接详细信息 - 老实说,我倾向于使用广泛使用和记录在案的 SendGrid 免费插件。

    【讨论】:

      猜你喜欢
      • 2014-12-31
      • 2011-08-11
      • 1970-01-01
      • 2015-03-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-07-08
      • 1970-01-01
      相关资源
      最近更新 更多