Installing mailcatcher in windows

When working in PHP you come accross situations where you need to see the current emails sent using PHP’s mail function. For this you need a a mail catcher.

The 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://127.0.0.1:1025 instead of your default SMTP server, then check out http://127.0.0.1:1080 to see the mail that’s arrived so far.

Follow those steps to get you ready:

  1. Install the ruby and rubygems as described here
  2. Install mail catcher
    gem install mailcatcher
  3. Add an alias (check also how to permanently add aliases in bash)
    alias mc='D:/tools/ruby/bin/mailcatcher.bat'
  4. Edit php.ini settings near [mail function]
    SMTP = 127.0.0.1
    smtp_port = 1025
    sendmail_from = aidrissi@example.com
  5. Restart Wamp server
  6. Now run this command to open a browser and listen for the mails!
    mc -b

    This will open a browser window with mail catcher admin.

Errors?

I had an error with utf-8  characters and fixed it by the following:

First stop the ruing mailcatcher from the browser (the quit button) then downgrade mailcatcher to the version without error with character encoding:

gem uninstall mailcatcher
gem install mailcatcher -v 0.5.12

One thought on “Installing mailcatcher in windows

  1. dizballanze says:

    Give a try to service https://debugmail.io/.

Comments are closed.