Forked from tansengming/Rails Console Actionmailer test.rb
Last active
December 24, 2015 14:59
-
-
Save jrhorn424/6816499 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# First, copy your settings over | |
ActionMailer::Base.smtp_settings = { | |
:address => "smtp.mandrillapp.com", | |
:port => 587, | |
:domain => "ices-experiments.org", | |
:user_name => Settings.mandrill_user, | |
:password => Settings.mandrill_password, | |
:authentication => "login" | |
} | |
# Copy and paste this to the rails console to test your email settings | |
class TestMailer < ActionMailer::Base | |
default :from => "[email protected]" | |
def welcome_email | |
mail(:to => "[email protected]", :subject => "Test mail", :body => "Test mail body") | |
end | |
end | |
TestMailer.welcome_email.deliver | |
# if all goes well you should see a lot text scrolling by | |
# Copied with love from http://lists.radiantcms.org/pipermail/radiant/2007-February/003394.html | |
# btw for info on how to get rails working with Gmail SMTP go to http://robertbousquet.com/articles/using-gmail-smtp-with-actionmailer |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment