Im running this on heroku. I have verified the domain with sparkpost. It says ready to send. I changed The real url to "example".
mailers/order_mailer.rb
class OrderMailer < ActionMailer::Base
default from: "orders@example.com"
def new_order(order)
@order = order
mail(to: @order.user.email, subject: 'Order Created!')
end
end
config/environments/production.rb
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
address: ENV['SPARKPOST_SMTP_HOST'],
port: ENV['SPARKPOST_SMTP_PORT'],
user_name: ENV['SPARKPOST_SMTP_USERNAME'],
password: ENV['SPARKPOST_SMTP_PASSWORD'],
domain: 'example.com',
authentication: :plain
}
config.action_mailer.default_url_options = {
:host => 'example.com'
}
error
2018-10-10T02:01:02.371812+00:00 app[web.1]: [3054201e-f06a-4acd-bff8-58947353fb72] Net::SMTPFatalError (550 5.7.1 Unconfigured Sending Domain <example.com>
I cant think of anything else, but if you need anything let me know.