Posted about 1 month ago. Visible to the public.

Rails: How to send a test mail directly from the console

I use this Code Snippet quite often to debug issues with mails on staging and production servers. It allows you to send a custom mail directly from the console.

Copy
ActionMailer::Base.mail( from: "system@example.com", to: "user@example.com", subject: "Test mail from #{Rails.application.class}", body: "This is just a test." ).deliver_now

makandra has been working exclusively with Ruby on Rails since 2007. Our laser focus on a single technology has made us a leader in this space.

Owner of this card:

Avatar
Emanuel De
Last edit:
20 days ago
by Emanuel De
About this deck:
We are makandra and do test-driven, agile Ruby on Rails software development.
License for source code
Posted by Emanuel De to makandra dev
This website uses cookies to improve usability and analyze traffic.
Accept or learn more