⇦ Back to Mail classMethod getInstance
public static \Joomla\CMS\Mail\Mail
getInstance
(mixed $id = 'Joomla', mixed $exceptions = true)
Returns the global email object, only creating it if it doesn't already exist.
Parameters
- string $id The id string for the Mail instance [optional]
- bool $exceptions Flag if Exceptions should be thrown [optional]
Returns
- \Joomla\CMS\Mail\Mail The global Mail object
Since
Method getInstance - Source code
public static function getInstance($id = 'Joomla', $exceptions = true)
{
if (empty(static::$instances[$id])) {
static::$instances[$id] = new static($exceptions);
}
return static::$instances[$id];
}