Question

I'm working on a new Joomla site and am working on testing outgoing email. I'd like to be able to intercept all outgoing emails and reroute them to an address I specify. It is very useful in development when you have a copy of a live site with thousands of users, so email does not go to real users from the copy site.

It would be great to do this with a extension but have been unable to find one to do some. I'm also open to getting this done on the server side if necessary.

I found a Drupal module that does exactly what I'd like to do except it's obviously for Drupal and note Joomla.

https://drupal.org/project/reroute_email

Was it helpful?

Solution

On Joomla-Level you could create a system plugin that loads up own, monkey-patched JMail class.

I'm not sure if you would be able to extend the original JMail because of namespace conflict, so maybe you'd have copy it over and alter the addRecipient method:

public function addRecipient($recipient, $name = '')
{
    $this->add('custom@email.com', 'custom name', 'AddAddress');

    return $this;
}

References:

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top