Rails3 ActionMailer deliveries in development environment
Is it possible to send mailers in the development environment?
I've added this to my development.rb file:
ActionMailer::Base.delivery_method = :smtp
ActionMailer::Base.perform_deliveries = true
ActionMailer::Base.smtp_settings = {
:address => "mail.email.com",
:port => 25,
:domain => 'email.com',
:user_name => 'email@email.com',
:password => 'password',
:authentication => 'plain',
:enable_starttls_auto => true }
Then I run UserMailer.welcome_email(@user).deliver
in rails console which returns #<Mail::Message:2265713480, Multipart: true, Headers: <Date: Thu...
but I never actually receive the email. Is there something else I need开发者_高级运维 to configure?
Oh, and if I check ActionMailer::Base.deliveries
it returns an empty hash => []
.
Needed to add the following to environments/development.rb
:
ActionMailer::Base.delivery_method = :smtp
ActionMailer::Base.perform_deliveries = true
精彩评论