Posted about 1 month ago. Visible to the public.

ActionMailer: send mail from console

If your rails application is unable to send mails, it might be useful to debug your settings using the rails console. Here is a snippet that shows the current settings and lets you send a test mail directly from the console:

Copy
m = ActionMailer::Base.new # check settings: m.delivery_method # -> :smtp m.smtp_settings # -> { address: "localhost", port: 25, domain: "localhost.localdomain", user_name: nil, password: nil, authentication: nil, enable_starttls_auto: true } # send mail: m.mail(from: 'sender@example.com', to: 'recipient@example.com', subject: 'test') do |format| format.text { m.render plain: "Hello, you've got mail!" } end.deliver

Does your version of Ruby on Rails still receive security updates?
Rails LTS provides security patches for old versions of Ruby on Rails (3.2 and 2.3).

Author of this card:

Avatar
Daniel Straßner
Last edit:
23 days ago
by Daniel Straßner
About this deck:
We are makandra and do test-driven, agile Ruby on Rails software development.
License for source code
Posted by Daniel Straßner to makandra dev