Skip to content

OSX: Getting Mails Sent Out By Your Script On Your Local System With MailCatcher

dhtmldhtml Posts: 27
edited August 7 in General

MailCatcher runs a super simple SMTP server which catches any message sent to it to display in a web interface. Run mailcatcher, set your favourite app to deliver to smtp:// instead of your default SMTP server, then check out to see the mail that's arrived so far.

Setting Up

Normally, the command below should work:

$ gem install mailcatcher

But if you are having challenges, try this:

$ gem install mailcatcher -- --with-cflags="-Wno-error=implicit-function-declaration"

At the time of this tutorial, I was testing this one:

OSX Catalina

$ rvm --version

rvm 1.29.12-next (master) by Michal Papis, Piotr Kuczynski, Wayne E. Seguin []

$ ruby --version

ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-darwin19]

To start mailcatcher:

$ mailcatcher

Starting MailCatcher

== smtp://

/usr/local/rvm/gems/ruby-2.4.0/gems/thin-1.5.1/lib/thin/server.rb:104: warning: constant ::Fixnum is deprecated


*** MailCatcher runs as a daemon by default. Go to the web interface to quit.

Starting Mail-Catcher On Login

Place me.mailcatcher.plist into ~/Library/LaunchAgents, then run launchctl load ~/Library/LaunchAgents/me.mailcatcher.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
<string>$SHELL --login -c "mailcatcher --foreground"</string>
Sign In or Register to comment.