Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vesan/54427a60c2a006316272b41939de54a6 to your computer and use it in GitHub Desktop.
Save vesan/54427a60c2a006316272b41939de54a6 to your computer and use it in GitHub Desktop.
Rails Console Actionmailer test
# Copy and paste this to the rails console to test your email settings
class MyMailer < ActionMailer::Base
def test_email
@recipients = "vesa@kiskolabs.com"
@from = "must_be_same_as_smpt_account_login@gmail.com"
@subject = "Test from the Rails Console"
@body = "This is a test email"
end
end
MyMailer.test_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