devise.rb - 调用send_reset_password_instructions时的Net :: SMTPSyntaxError

时间:2014-12-22 22:02:55

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

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

调用函数的片段:

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

我在这里错过了什么吗?

1 个答案:

答案 0 :(得分:1)

这个错误与devise无关..它与SMTP ActionMailer的配置有关。查看内部并验证:smtp的配置,以便在development.rb中发送邮件{1}}或devise.rb(无论您在何处配置)