XF 2.1 Get emails on the test email for testing?

sajal

Active member
Is there any plugin or a setting which allows us to receive all emails on a particular "test" email, since we don't to enable email feature globally and thus ending up sending emails to actual users.... as it's our test server.

Thanks in advance.
 
There are a few solutions.

There’s a hosted service (but may be too limiting outside of basic development purposes) called MailTrapper.io. This gives you an SMTP server which traps all outbound emails and stores them for you.

Similarly there is an application you can install on your server called Mailhog.


This sets up an SMTP server locally on port 1025 and if you point your mail options towards that, you can view any emails the forum has sent using a web browser pointed to your server and port 8025.

You can also have XF dump all of the emails it sends into files using this config.php change:
PHP:
/** @var $c \XF\Container */
$c->extend('mailer.transport', function()
{
    return \XF\Mail\Mailer::getTransportFromOption('file', [
        'path' => \XF::getRootDirectory() . '/internal_data'
    ]);
});
 
Back
Top Bottom