A quick script for testing ActionMailer settings
Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
Gemfile
Gemfile.lock
README.md
action_mailer_test.rb

README.md

Overview

This project is for testing various ActionMailer settings. Right now it's configured using ActionMailer 2.3.11, but it can easily be adapted to use other versions if necessary.

Configuration

Clone the repository:

git clone https://github.com/watsonian/action_mailer_test.git

Make sure you have bundler installed:

gem install bundler

Switch directories to the cloned repo and bundle install:

cd action_mailer_test
bundle install

Now edit the action_mailer_test.rb file. You'll need to make sure you set the TO_ADDRESS and FROM_ADDRESS constants and then adjust the smtp settings.

Usage

To actually test things out, you'll need to run the following command from your local clone:

bundle exec ruby action_mailer_test.rb

There will be no output if it's successful -- you'll know it works because you should receive an email at the TO_ADDRESS you specified. If it fails for some reason, the error will be displayed.

FAQ

Q: What settings do I need to use an SMTP server that doesn't require authentication?

A: Remove the user_name, password, and authentication keys from the smtp settings hash. That should work for you then assuming the other settings are correct.