JFactory stopped working in Joomla 3.8, what now?

by Firefighter   Last Updated October 05, 2017 11:10 AM

A client called today lamenting that our automated mail (they fill a form and we mail them a code) is not working.

Of course, this is because my code still has the JFactory class and is looking for...

require ('libraries/joomla/factory.php');

...which is no more since Joomla 3.8

I have seen this answer to a similar problem, but getMailer is not named in the linked Github file.

What should I use instead of the following lines?

require ('libraries/joomla/factory.php'); #I suppose nothing
$mail = JFactory::getMailer(); #I have no idea

Of course I'm instantiating the $mail object with everything needed to use


So if that won't work anymore I'd appreciate some guidance.

Related Questions

CLI: Can not fetch members of specific groups

Updated June 29, 2015 15:04 PM

_getTab() returns spaces

Updated May 21, 2015 21:04 PM

Why am I getting two records added on one insert

Updated August 03, 2015 14:04 PM