MODX + MailCatcher
Thanks to Thorsten Born of the MODX community for providing the mail settings.
A Real (Ruby) Gem
MailCatcher as you probably guessed is a Ruby Gem created by Samuel Cochran. It functions as a local SMTP server with a basic GUI for email testing, sending and debugging which is useful for Web application development.
I use it for CMS work to ensure my front-end forms are functioning properly before going live. For the purpose of this tutorial I’ll show you how to configure the MODX mail settings, but MailCatcher could be used with other Web applications/CMS1.
MODX Mail Configuration
- Sign-in to the MODX Manager.
- Go to Menu > [ Cog ] > System Settings.
- Leave the picker at the default core setting and in the Filter by area... picker select Mail. You should see 13 Mail settings. We’re only concerned with 4 of them.
SMTP Authenticationset to the default
- Using the Terminal (command-line) type
gem install mailcatcherhit Return and wait for the prompt.
- Then type
MailCatcherand hit Return. If all goes well you should see:
Starting MailCatcher==> smtp://127.0.0.1:1025 ==> http://127.0.0.1:1080 *** MailCatcher runs as a daemon by default. Go to the web interface to quit.
- In your browser go to http://localhost:1080/, you should now see the MailCatcher GUI. Your locally sent messages will appear here.
Mail will now be sent through smtp://localhost:1025.
* To (re)start MailCatcher repeat Step 2.
You’re Ready to Go
You should now have MailCatcher running in your browser, and if you configured the mail settings correctly when you send emails through your local MODX-built site they should instantly appear in the MailCatcher GUI. The MailCatcher site has additional advanced configuration options which may be of interest to you technical types.
Alternatively MailHog (see my tutorial) is another option. Essentially it performs the same function as MailCatcher though with a simpler installation process and a couple features doesn’t have. It is also written in Go, not Ruby.
1 Depending on the application the configuration process may vary.