Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Capture development emails with Mailpit #18

Open
gshaw opened this issue Nov 5, 2023 · 1 comment
Open

Capture development emails with Mailpit #18

gshaw opened this issue Nov 5, 2023 · 1 comment
Labels

Comments

@gshaw
Copy link
Owner

gshaw commented Nov 5, 2023

My preferred way to capture and view emails being sent by a Rails app in development is to use Mailpit. It runs a local SMTP server at port 1025 and a barebones email client at port 8025. I used to use MailHog but development has stalled. Mailpit has the same ease of use while supporting newer features and looking nicer.

The mailpit utility can be installed with brew:

brew install mailpit
brew services start mailpit

The development smtp settings are configured in config/environments/development.rb:

config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = { address: "localhost", port: 1025 }

All outgoing email from the development server will be captured and viewable in
both html and text form at localhost:8025.

Source: https://github.com/jbranchaud/til/blob/master/rails/capture-development-emails-with-mailhog.md

@gshaw gshaw added the Rails label Nov 5, 2023
@gshaw gshaw changed the title Capture Development Emails With Mailhog Capture development emails with Mailhog Nov 5, 2023
@gshaw gshaw changed the title Capture development emails with Mailhog Capture development emails with MailHog Nov 5, 2023
@gshaw
Copy link
Owner Author

gshaw commented Nov 5, 2023

See https://www.jdeen.com/blog/configure-default-url-options-on-rails for more information about getting routes to work with a hostname in development.

@gshaw gshaw changed the title Capture development emails with MailHog Capture development emails with Mailpit Nov 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant