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)
精彩评论