/ rails

Rails - Send mail from localhost with sendmail

Saw many answers that points to using Google's SMTP.

Well, you can use that, or, if you already have sendmail installed in your machine, just add these few lines to setup action_mailer and start sending mail from your localhost!

/config/development.rb

config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }
config.action_mailer.delivery_method = :sendmail
config.action_mailer.raise_delivery_errors = true

It also raise an error in development so you know if the mail was sent successfully.

Tested in OSX machine, rails v5.1.1.

Additional configuration if needed:
http://guides.rubyonrails.org/action_mailer_basics.html#action-mailer-configuration

Rails - Send mail from localhost with sendmail
Share this