Why is my Rails app trying to send an email in the development environment?
I have followed the instructions on this page to get started on A开发者_运维技巧ctionMailer. After I tested that it can send emails from a Gmail account, I reset perform_deliveries option to false and sent a few test emails. Even though these emails shouldn't get sent, I can look at the /var/log/mail.log and see that it's still trying to send emails from smtp, and I get constant popups warning me about "operation timed out"
Here is a sample error:
postfix/smtp[2837]: connect to gmail-smtp-in.l.google.com[74.125.93.27]:25: Operation timed out
How can I make sure that Rails doesn't attempt to send emails when I am in the development mode? I assumed this would be automatic since I have set perform_deliveries set to false.
Try setting config.action_mailer.delivery_method = :test
in your development.rb
file.
Please check if you using ActionMailer #deliver method and not #deliver! because last one bypass checking perform_deliveries
精彩评论