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
Symfony2 Swiftmailer configuration with mailcatcher: