Trent Scott
Trent Scott

Reputation: 2028

Devise Not Sending Mail

I have the following in my config/environments/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 => "[email protected]",
    :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?

Upvotes: 0

Views: 3476

Answers (1)

Will Ayd
Will Ayd

Reputation: 7164

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)

Upvotes: 3

Related Questions