05/25/2018: tested with macOS Sierra High 10.12.6
08/04/2020: added @mayesa's suggestion to fix an exception with EventMachine 08/04/2020: tested with macOS Catalina 10.15.5
Install MailCatcher:
brew install ruby
sudo gem install mailcatcher
Run:
mailcatcher &
To set it up for PHP: edit php.ini (on OSX brew, /usr/local/etc/php/5.5/conf.d/mailcatcher.ini) and paste the following configuration:
sendmail_path = /usr/bin/env /usr/local/bin/catchmail -f [email protected]
put any email you want instead of
[email protected]
To test it:
php -r "mail('[email protected]', 'test', 'test');"
Then, visit the mailcatcher backend : http://localhost:1080
- If you got a
'require': cannot load such file -- i18n/core_ext/string/interpolate (LoadError)
exception, run:
sudo gem uninstall i18n
sudo gem install i18n -v 0.6.11
sudo gem install interpolate
(see sj26/mailcatcher#155)
- If you got an
Unable to load the EventMachine C extension
exception, run:
sudo gem uninstall mailcatcher eventmachine
sudo gem install mailcatcher
Hi i have installed mailcatcher using the standard 'brew' and 'gem' approach described above. During the past year everything worked fine, but quite recently (using MacOS Catalina 10.15.4) i started getting following error message and i'm unable to start mailcatcher:
Unable to load the EventMachine C extension; To use the pure-ruby reactor, require 'em/pure_ruby' Traceback (most recent call last): 10: from /usr/local/bin/mailcatcher:23:in '<main>' 9: from /usr/local/bin/mailcatcher:23:in 'load' 8: from /Library/Ruby/Gems/2.6.0/gems/mailcatcher-0.7.1/bin/mailcatcher:3:in '<top (required)>' 7: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in 'require' 6: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in 'require' 5: from /Library/Ruby/Gems/2.6.0/gems/mailcatcher-0.7.1/lib/mail_catcher.rb:15:in '<top (required)>' 4: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in 'require' 3: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in 'require' 2: from /Library/Ruby/Gems/2.6.0/gems/eventmachine-1.0.9.1/lib/eventmachine.rb:8:in '<top (required)>' 1: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in 'require' /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in 'require': dlopen(/Library/Ruby/Gems/2.6.0/gems/eventmachine-1.0.9.1/lib/rubyeventmachine.bundle, 0x0009): dependent dylib '/usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib' not found for '/Library/Ruby/Gems/2.6.0/gems/eventmachine-1.0.9.1/lib/rubyeventmachine.bundle' - /Library/Ruby/Gems/2.6.0/gems/eventmachine-1.0.9.1/lib/rubyeventmachine.bundle (LoadError)