Reputation: 10888
I am working on a Rails application with Devise gem for authentication. I cannot recieve emails sent during Devise process like forgot password, as it seems mailing is not configured properly.
i tried to add configuration in production.rb file
config.action_mailer.delivery_method = :smtp
config.action_mailer.default_url_options = { :host => 'smtp.mydomain.com' }
What am i doing wrong? do i have to add any more configuration?
Upvotes: 0
Views: 193
Reputation: 10888
I got it working with the below configuration in production.rb file under environment
config.action_mailer.default_url_options = { :host => "http://your_domain_name.com" }
ActionMailer::Base.smtp_settings = {
:address => "smtp.smtp_server_name.com",
:port => 25,
:authentication => :plain
}
Hope it helps someone.. :)
Upvotes: 0
Reputation: 3085
Have a look here.
http://railscasts.com/episodes/206-action-mailer-in-rails-3/
In that railscast there is a lot of example code that may help you.
config/initializers/setup_mail.rb
ActionMailer::Base.smtp_settings = {
:address => "smtp.gmail.com",
:port => 587,
:domain => "railscasts.com",
:user_name => "railscasts",
:password => "secret",
:authentication => "plain",
:enable_starttls_auto => true
}
Upvotes: 1