【问题标题】:Sending Mail in Rails App Heroku在 Rails 应用程序 Heroku 中发送邮件
【发布时间】:2013-01-20 00:45:29
【问题描述】:

我的用户可以通过电子邮件邀请其他人加入他们正在从事的项目,但我不断收到以下错误-

Net::SMTPAuthenticationError 

这是我为生产环境配置邮件设置的方式

  config.action_mailer.default_url_options = { :host => 'myapp.herokuapp.com' }

  #Sending email on the production side
  config.action_mailer.smtp_settings = {
    :enable_starttls_auto => true,
    :address => "smtp.gmail.com",
    :port => "587",
    :domain => "gmail.com",
    :authentication => :plain,
    :user_name => "example@gmail.com",
    :password => "password"
  }

它像我期望的那样在我的本地环境中使用 sqlite3,但是当我推送到 heroku 时,它会在运行 heroku 日志后引发上述错误。我相信我的配置设置是正确的,显然 heroku 使用 postgresql,所以我在这里缺少什么?

感谢您的关注。

【问题讨论】:

    标签: ruby-on-rails postgresql heroku devise actionmailer


    【解决方案1】:

    我在这里找到了原因How to send confirmation e-mails using gmail smtp service for registration using devise under development mode locally?

    Google 在新创建的帐户上检测到一些“可疑”活动,并阻止我发送电子邮件。验证帐户后,我可以使用上述配置发送电子邮件并切换:domain => "heroku.com"

    【讨论】:

      猜你喜欢
      • 2017-10-06
      • 1970-01-01
      • 1970-01-01
      • 2014-10-01
      • 2012-02-11
      • 2015-04-27
      • 1970-01-01
      • 2013-02-04
      相关资源
      最近更新 更多