The Goal

Learn how to configure the MODX mail settings to use the MailCatcher SMTP server for local email sending and debugging.

Author
Name:
Profession: Designer/Developer/Artist
Specialties: Front-end dev.; hand-drawing
Years’ Experience: 15
Employer: Self-employed
Tutorial Details
Experience Level: Noob
Noob: No technical skills required.
Beginner: Basic technical skills and knowledge.
Intermediate: Code literate. Strong technical skills.
Advanced: Code “fluent”. Extensive technical skills.
Über Geek: Need I say more?
Tools: MailCatcher, MODX, Terminal
Completion Time: Less than 15 minutes
Related Article: Source
Tags: mailcatcher, modx, ruby

This is a member-contributed tutorial. If possible, contact the author with questions or comments.

Easy Local Mail Testing

Credit
Thanks to Thorsten Born of the MODX community for providing the mail settings.

A Real (Ruby) Gem

MailCatcher is as you probably guessed a Ruby Gem, and it was 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

  1. Sign-in to the MODX Manager.
  2. Go to Menu > [ Cog ] > System Settings.
  3. 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.
  4. Leave SMTP Authentication set to the default No.
  5. Set SMTP Hosts to 127.0.0.1.
  6. Set SMTP Port to 1025.
  7. Set Use SMTP to Yes.

Installing MailCatcher

  1. Using the Terminal (command-line) type gem install mailcatcher hit Return and wait for the prompt.
  2. Then type MailCatcher and 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.
  3. 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.

Depending on the application the configuration process may vary.