So I was tired of doing different stuff to test email configuration on my many environments so I came up with this simple Rake task to send me a test email.
Include it on your Gemfile
And then run:
Other versions of Rails
Nope, this gem is just for Rails 3
Simply run the rake task passing the destination mail address as a parameter, for example:
If your mail configuration works, you shall receive a message immediately.
Be careful if you have different environments configured on your server. If you run your app in production mode, then you should run the rake task as:
RAILS_ENV=production rake hello_mail:deliver[email@example.com]
About the Author
Crowd Interactive is an American web design and development company that happens to work in Colima, Mexico. We specialize in building and growing online retail stores. We don’t work with everyone – just companies we believe in. Call us today to see if there’s a fit. Find more info here!