PHPackages                             captbaritone/mailcatcher-codeception-module - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. captbaritone/mailcatcher-codeception-module

ActiveLibrary[Testing &amp; Quality](/categories/testing)

captbaritone/mailcatcher-codeception-module
===========================================

Test emails in your Codeception acceptance tests

3.0.1(2y ago)1114.5M↓10.8%41[5 issues](https://github.com/captbaritone/codeception-mailcatcher-module/issues)[2 PRs](https://github.com/captbaritone/codeception-mailcatcher-module/pulls)9MITPHPPHP ^7.4 || ^8.0CI passing

Since Jul 11Pushed 5mo ago6 watchersCompare

[ Source](https://github.com/captbaritone/codeception-mailcatcher-module)[ Packagist](https://packagist.org/packages/captbaritone/mailcatcher-codeception-module)[ RSS](/packages/captbaritone-mailcatcher-codeception-module/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (5)Versions (24)Used By (9)

Codeception MailCatcher Module
==============================

[](#codeception-mailcatcher-module)

[![Build Status](https://camo.githubusercontent.com/01e8dc59b2ca242eb35c5fdfdb6be8f93750fad3e688ba73f221740cedab639c/68747470733a2f2f7472617669732d63692e6f72672f6361707462617269746f6e652f636f646563657074696f6e2d6d61696c636174636865722d6d6f64756c652e737667)](https://travis-ci.org/captbaritone/codeception-mailcatcher-module)

This module will let you test emails that are sent during your Codeception acceptance tests. It depends upon you having [MailCatcher](http://mailcatcher.me/) installed on your development server.

It was inspired by the Codeception blog post: [Testing Email in PHP](http://codeception.com/12-15-2013/testing-emails-in-php). It is currently very simple. Send a pull request or file an issue if you have ideas for more features.

Installation
------------

[](#installation)

1. Add the package to your `composer.json`:

    `composer require --dev captbaritone/mailcatcher-codeception-module`
2. Configure your project to actually send emails through `smtp://127.0.0.1:1025` in the test environment
3. Enable the module in your `acceptance.suite.yml`:

    ```
    modules:
        enabled:
            - MailCatcher
        config:
            MailCatcher:
                url: 'http://127.0.0.1'
                port: '1080'
    ```

Optional Configuration
----------------------

[](#optional-configuration)

If you need to specify some special options (e.g. SSL verification or authentication headers), you can set all of the allowed [Guzzle request options](https://guzzle.readthedocs.org/en/5.3/clients.html#request-options):

```
class_name: WebGuy
modules:
    enabled:
        - MailCatcher
    config:
        MailCatcher:
            url: 'http://127.0.0.1'
            port: '1080'
            guzzleRequestOptions:
                verify: false
                debug: true
                version: 1.0

```

Example Usage
-------------

[](#example-usage)

```
