Configure MailCatcher for Symfony2
Using MailCatcher in combination with Symfony2 on your development machine will make it easy to check the e-mails you are sending out.
What is MailCatcher
MailCatcher runs a super simple SMTP server which catches any message sent to it to display in a web interface.
Install MailCatcher dependecies, sqlite and ruby.
Install the MailCatcher Ruby gem
This will start up MailCatcher, but only when you trigger this command. I thinks it’s more convenient to start MailCatcher with Upstart.
Create an upstart script
Create and edit file
After configuring this upstart config file, you’re able to use the following set of commands:
sudo service mailcatcher start after that you should be able to visit the web interface on
10.0.0.2 with the ip of your development machine).
In order to re-route all mail traffic from Swiftmailer to MailCatcher, you should adjust your
config_dev.yml file with the following settings:
And Symfony2 profiler’ mail item?
Yes, that’s still working and for me personal this is a much faster way to check and validate emails and their content.
Thanks for reading
Feel free to leave a comment if you have remarks or like this post