devise.rb - Net :: SMTPSyntaxError调用send_reset_password_instructions时 [英] devise.rb - Net::SMTPSyntaxError when calling send_reset_password_instructions
问题描述
send_reset_password_instructions({:email =>'my@email.com')时,我正在获得 Net :: SMTPSyntaxError 501语法错误
})
设计助手。我使用的是Ruby 1.9.3,Rails 3.2.19和devise 2.2.8。 调用函数的代码片段:
class UserController
def reset
User.send_reset_password_instructions(hash_params)#{:email => 'my@email.com'}
#...更多代码在这里...
end
end
User类有以下设计模块被激活:
用户
...
devise:可注册,:database_authenticatable,:可恢复,
:可记忆,可追溯,可验证,,omniauthable
##设计字段
##数据库可认证
字段:电子邮件,:type => String,:null => false
字段:encrypted_password,:type => String,:null => false
##可恢复
字段:reset_password_token,:type => String
field:reset_password_sent_at,:type =>时间
##可记住
字段:remember_created_at,:type =>时间
##可追踪
字段:sign_in_count,:type =>整数
字段:current_sign_in_at,:type =>时间
字段:last_sign_in_at,:type =>时间
字段:current_sign_in_ip,:type => String
字段:last_sign_in_ip,:type => String
...
end
我错过了一些这里?
这个错误与 devise
不相关它与SMTP的配置 ActionMailer
有关。查看内部并验证的配置:smtp
发送邮件在 development.rb
或 devise.rb
(无论您配置的位置)
I am getting Net::SMTPSyntaxError 501 Syntax Error
when calling the send_reset_password_instructions({:email => 'my@email.com'})
Devise helper. I am using Ruby 1.9.3, Rails 3.2.19 and devise 2.2.8.
A snippet of the calling function:
class UserController
def reset
User.send_reset_password_instructions(hash_params) # {:email => 'my@email.com'}
# ... more code down here ...
end
end
The User class has the following devise modules activated:
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
Am I missing something here?
well this error is not related to devise
..its related to configuration of ActionMailer
for SMTP ..Have a look inside and verify the configuration for :smtp
for sending mail in development.rb
or devise.rb
(wherever you have configured)
这篇关于devise.rb - Net :: SMTPSyntaxError调用send_reset_password_instructions时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!