Back to Factory class

Method getMailer

public static \Joomla\CMS\Mail\Mail
getMailer
()
Get a mailer object.
Returns
  • \Joomla\CMS\Mail\Mail object
Since
  • 1.7.0
-
  • \Joomla\CMS\Mail\Mail
Class: Factory
Project: Joomla

Method getMailer - Source code

/**
 * Get a mailer object.
 *
 * Returns the global {@link Mail} object, only creating it if it doesn't already exist.
 *
 * @return  Mail object
 *
 * @see     Mail
 * @since   1.7.0
 */
public static function getMailer()
{
    if (!self::$mailer) {
        self::$mailer = self::createMailer();
    }
    $copy = clone self::$mailer;
    return $copy;
}