i am using rails and devise and i am trying to send emails but i get the following error in production and test eviroments, in development all works fine:
ActionView::Template::Error: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true # ./app/views/devise/mailer/reset_password_instructions.html.erb:9:in `_app_views_devise_mailer_reset_password_instructions_html_erb___200197999_97517150'
My development.rb
config.action_mailer.delivery_method = :smtp
config.action_mailer.default_url_options = { :host => "localhost:3000" }
config.action_mailer.perform_deliveries = true
config.action_mailer.raise_delivery_errors = true
config.action_mailer.default :charset => "utf-8"
test.rb
config.action_mailer.delivery_method = :test
config.action_mailer.default_url_options = { :host => "localhost:3000" }
production.rb
config.action_mailer.default_url_options = { :host => "mydomain.com" }
config.action_mailer.delivery_method = :smtp
config.action_mailer.perform_deliveries = true
config.action_mailer.raise_delivery_errors = false
config.action_mailer.default :charset => "utf-8"
reset_password_instructions.html.erb
<p>Hello, <%= @resource.full_name %>!</p>
<p>You have request a new passord</p>
<p><%= link_to 'Change my password', edit_password_url(@resource, :reset_password_token => @token), class: 'btn btn-info' %></p>
<p>If you didn't request this, please ignore this email.</p>
<p>Your password won't change until you access the link above and create a new one.</p>
Where is the error?