Lack of interest Whitelist of emails to still send to even with $config['enableMail'] on

This suggestion has been closed automatically because it did not receive enough votes over an extended period of time. If you wish to see this, please search for an open suggestion and, if you don't find any, post a new one.

Jake B.

Well-known member
If there was a way I could do something like this:

PHP:
$config['enableMail'] = false;
$config['enableMail']['whitelist'] = [
    'user1@domain.com',
    'user2@domain.com',
];

and it'll still send email to the users specified that'd enable testing emails after an import without accidentally having things sent incorrectly
 
Upvote 0
This suggestion has been closed. Votes are no longer accepted.
For mail testing, regardless of the scenario, I'd recommend one of two things.

1. File transport

This lets you trap all mails and have them written out to the file system. Just add the following to config.php:
PHP:
/** @var $c \XF\Container */
$c->extend('mailer', function(\XF\Mail\Mailer $mailer)
{
    $transport = \XF\Mail\Mailer::getTransportFromOption('file', [
        'path' => \XF::getRootDirectory() . '/internal_data'
    ]);
    $mailer->setDefaultTransport($transport);
    return $mailer;
});

2. MailTrap.io

My personal favourite. This is a special SMTP server you can use and will make all of the emails you send in their webmail like interface. You can actually set it all up in the config.php file too similar to the above.

File transport is probably the easiest. Can do a similar config.php approach in XF1 too:
PHP:
$transport = new Zend_Mail_Transport_File([
    'path' => XenForo_Helper_File::getInternalDataPath()
]);
XenForo_Mail::setupTransport($transport);
 
Back
Top Bottom