ruby-on-rails – 连接到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'

我的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'
  }

解决方法

我有这个,它适用于我:
ActionMailer::Base.smtp_settings = {
    :address              => "smtp.gmail.com",:port                 => 587,:user_name            => "name@example.com",:password             => 'password',:authentication       => "plain",:enable_starttls_auto => true
  }

相关文章

validates:conclusion,:presence=>true,:inclusion=>{...
一、redis集群搭建redis3.0以前,提供了Sentinel工具来监控各...
分享一下我老师大神的人工智能教程。零基础!通俗易懂!风趣...
上一篇博文 ruby传参之引用类型 里边定义了一个方法名 mo...
一编程与编程语言 什么是编程语言? 能够被计算机所识别的表...
Ruby类和对象Ruby是一种完美的面向对象编程语言。面向对象编...