Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Missing host to link to! Please provide :host parameter or set default_url_options[:host]
- config.action_mailer.default_url_options = { :host => 'localhost:3000' }
- config.action_mailer.default_url_options = { :host => 'mywebsitename.com' }
- config.action_mailer.default_url_options = { :host => 'heroku.mywebsitename.com' }
- config.action_mailer.default_url_options = { :host => 'yourapp.heroku.com' }
- User.create(:username => "test", :email => "test@test.com", :password => "test1234", :password_confirmation => "test1234", :confirmed_at => "2010-11-03 14:11:15.520128")
- ActionView::Template::Error: Missing host to link to! Please provide :host parameter or set default_url_options[:host]
- /home/slugs/.../mnt/.bundle/gems/ruby/1.8/gems/actionpack-3.0.0/lib/action_dispatch/routing/route_set.rb:473:in `url_for'
- /home/slugs/.../mnt/.bundle/gems/ruby/1.8/gems/actionpack-3.0.0/lib/action_dispatch/routing/url_for.rb:132:in `url_for'
- /home/slugs/.../mnt/.bundle/gems/ruby/1.8/gems/actionpack-3.0.0/lib/action_view/helpers/url_helper.rb:99:in `url_for'
- /home/slugs/.../mnt/.bundle/gems/ruby/1.8/gems/actionpack-3.0.0/lib/action_dispatch/routing/route_set.rb:195:in `user_confirmation_url'
- config.action_mailer.default_url_options = { :host => 'yourapp.heroku.com' }
- Errno::EAFNOSUPPORT: Address family not supported by protocol - socket(2)
- /usr/ruby1.8.7/lib/ruby/1.8/net/smtp.rb:551:in `initialize'
- /usr/ruby1.8.7/lib/ruby/1.8/net/smtp.rb:551:in `open'
- /usr/ruby1.8.7/lib/ruby/1.8/net/smtp.rb:551:in `do_start'
- /usr/ruby1.8.7/lib/ruby/1.8/timeout.rb:62:in `timeout'
- config.action_mailer.default_url_options = { :host => 'localhost' }
- config.action_mailer.default_url_options = { :host => 'yourapp.heroku.com' }
- heroku addons:add sendgrid:free
- config.action_mailer.default_url_options = { :host => 'localhost:3000' }
- config.action_mailer.default_url_options = { :host => 'yourapp.heroku.com' }
- config.action_mailer.default_url_options = { :host => ENV['MAILER_URL'] }
- heroku config:set MAILER_URL=my-awesome-app.herokuapp.com --app my-awesome-app
- ActionMailer::Base.smtp_settings = {
- :address => 'smtp.sendgrid.net',
- :port => '587',
- :authentication => :plain,
- :user_name => ENV['SENDGRID_USERNAME'],
- :password => ENV['SENDGRID_PASSWORD'],
- :domain => 'heroku.com'
- }
- ActionMailer::Base.delivery_method = :smtp
- config.action_mailer.default_url_options = { :host => 'YOUR-DOMAIN-HERE.COM' }
- Rails.application.routes.default_url_options[:host] = 'myappsname.herokuapp.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"
- class MyMailController < ApplicationController
- before_filter :set_host_from_request, only: [:create]
- ....
- private
- def set_host_from_request
- ActionMailer::Base.default_url_options = { host: request.host_with_port }
- end
- end
- #config.action_mailer.default_url_options = { :host => 'mydomain.com' }
- $rails console
- User.invite!(email: "ceo@example.com")
- ActionView::Template::Error: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true
- ...stacktrace
- class ApplicationMailer < ActionMailer::Base
- default from: 'yourmail@gmail.com'
- layout 'mailer'
- end
- config.action_mailer.default_url_options =
- { :host => 'yourapp.herokuapp.com' }
- config.action_mailer.delivery_method = :smtp
- config.action_mailer.smtp_settings = {
- address: 'smtp.gmail.com',
- port: 587,
- domain: 'heroku.com',
- user_name: 'yourmail@gmail.com',
- password: 'yourgmailpassword',
- authentication: 'login',
- enable_starttls_auto: true
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement