【问题标题】:devise.rb - Net::SMTPSyntaxError when calling send_reset_password_instructionsdevise.rb - 调用 send_reset_password_instructions 时的 Net::SMTPSyntaxError
【发布时间】:2014-12-22 22:02:55
【问题描述】:

我在调用send_reset_password_instructions({:email => 'my@email.com'}) 设计助手时收到Net::SMTPSyntaxError 501 Syntax Error。我正在使用 Ruby 1.9.3、Rails 3.2.19 并设计 2.2.8。

调用函数的一个sn-p:

class UserController
    def reset
        User.send_reset_password_instructions(hash_params) # {:email => 'my@email.com'}

        # ... more code down here ...
    end
end

User 类激活了以下设计模块:

class User
    ...

    devise :registerable, :database_authenticatable, :recoverable,
        :rememberable, :trackable, :validatable, :omniauthable

    ## Devise Fields
    ## Database authenticatable
    field :email,              :type => String, :null => false
    field :encrypted_password, :type => String, :null => false

    ## Recoverable
    field :reset_password_token,   :type => String
    field :reset_password_sent_at, :type => Time

    ## Rememberable
    field :remember_created_at, :type => Time

    ## Trackable
    field :sign_in_count,      :type => Integer
    field :current_sign_in_at, :type => Time
    field :last_sign_in_at,    :type => Time
    field :current_sign_in_ip, :type => String
    field :last_sign_in_ip,    :type => String       

    ...
end

我错过了什么吗?

【问题讨论】:

    标签: ruby-on-rails ruby-on-rails-3 devise


    【解决方案1】:

    这个错误与devise无关..它与ActionMailer的SMTP配置有关..查看内部并验证:smtp的配置以在development.rbdevise.rb中发送邮件(无论您在哪里配置)

    【讨论】:

      猜你喜欢
      • 2016-05-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-09-11
      • 1970-01-01
      • 2019-10-01
      相关资源
      最近更新 更多