Testing Your ActionMailer Configuration


Sometimes with Rails you just want to test basic email sending from the console. Here is how you can do it, without needing a Mailer or views or anything:

  to:      'dest@example.com',
  from:    'src@example.com', 
  subject: 'test',
  body:    'testing',

Or in older versions use deliver instead of deliver_now. This will use your ActionMailer settings but doesn’t require anything else, so you can test just the SMTP config (or whatever).

blog comments powered by Disqus Prev: Validating FieldArrays in Redux Form Next: Adding an if method to ActiveRecord::Relation