If you use Vagrant and VVV for WordPress development, this might be useful for you. MailCatcher is the latest tool added to VVV. To make it work properly, please do the following:

  1. You need to edit php.ini file and change smtp port to smtp_port = 1025
  2. Change file: /etc/php5/mods-available/mailcatcher.ini to:
    sendmail_path = "/usr/local/bin/catchmail -f [email protected]"
  3. Restart nginx and php-fpm

All should work properly after and you can catch mail sent by php mail function

 

Copy and paste to functions.php file to quickly create custom post type for WordPress