I know this issue is there a thousand times. But mine seems strange :-)
I am using heroku. I wanna mail via SMTP. What are my correct settings for sending emails?
Please keep in mind, that my MailService is something like "gmail" or "gmx" and not my host superapp.herokuapp.com
my application.rb:
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
from: ENV['MAIL_SENDER_EMAIL_ADDRESS'],
address: ENV['MAIL_SENDER_SERVER_HOST'],
authentication: :login,
enable_starttls_auto: ENV['MAIL_SENDER_TLS'],
user_name: ENV['MAIL_SENDER_USERNAME'],
password: ENV['MAIL_SENDER_PASSWORD']}
config.action_mailer.default = {
:charset => "utf-8",
from: ENV['MAIL_SENDER_EMAIL']}
config.action_mailer.raise_delivery_errors = false
config.action_mailer.perform_deliveries = true
in my production.rb
config.action_mailer.default_url_options = {host: ENV['RAILS_HOST']}
config.action_mailer.raise_delivery_errors = false
config.action_mailer.perform_deliveries = true
What is the right config to get rid of that error?
ActionView::Template::Error (Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true)
ENV['RAILS_HOST'] = "superapp.herokuapp.com"
does not work