相关疑难解决方法(0)

连接到gmail时rails 3.1.0.rc5中的Net :: SMTPAuthenticationError

当我尝试在我的rails应用程序中发送通知时,我收到以下错误

Net::SMTPAuthenticationError (535-5.7.1 Username and Password not accepted. Learn more at                   
):
  app/models/friendship.rb:6:in `send_request'
  app/controllers/friends_controller.rb:21:in `make_friendship'
Run Code Online (Sandbox Code Playgroud)

我的development.rb邮件配置设置是

  # Don't care if the mailer can't send
  config.action_mailer.raise_delivery_errors = true

  config.action_mailer.delivery_method = :smtp
  # Gmail SMTP server setup
  config.action_mailer.smtp_settings = {
        :address => "smtp.gmail.com",
        :enable_starttls_auto => true,
        :port => 587,
        :domain => '@example.com',
        :authentication => :plain,
        :user_name => 'user@gmail.com',
        :password => 'secret'
  }
Run Code Online (Sandbox Code Playgroud)

smtp ruby-on-rails

13
推荐指数
3
解决办法
2万
查看次数

标签 统计

ruby-on-rails ×1

smtp ×1