开发者

Devise Not Sending Mail

I have the following in my config/envi开发者_如何学Pythonronments/development.rb:

config.action_mailer.delivery_method = :smtp
  config.action_mailer.smtp_settings = {
    :enable_starttls_auto => true,
    :address => "smtp.gmail.com",
    :port => 587,
    :domain => "mydomain.com",
    :authentication => :login,
    :user_name => "myemaiL@mydomain.com",
    :password => "mypass"
  }

But, when I browse to localhost:3000/users/sign_in and try to run a forgot password (test email sending), I get this error:

RuntimeError in Devise/passwords#create

Showing /Users/TTS/.rvm/gems/ruby-1.9.2-p180/gems/devise-1.3.3/app/views/devise/mailer/reset_password_instructions.html.erb where line #5 raised:

Missing host to link to! Please provide :host parameter or set default_url_options[:host]

Any thoughts?


looks like you need to provide a default_url for your environment. try adding something like config.action_mailer.default_url_options = { :host => 'localhost:3000' } to your development.rb file (assuming this is for development)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜