开发者

Rails3 ActionMailer deliveries in development environment

开发者 https://www.devze.com 2023-04-09 18:09 出处:网络
Is it possible to send mailers in the development environment? I\'ve added this to my development.rb file:

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
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号