Getter for the mailer object

@return \PHPMailer\PHPMailer\PHPMailer
559378
public function getMailer()
    {
        if ($this->_mailer === null) {
            $this->_mailer = new PHPMailer();
            $this->_mailer->CharSet = 'UTF-8';
            $this->_mailer->From = $this->from;
            $this->_mailer->FromName = $this->fromName;
            $this->_mailer->isHTML(true);
            $this->_mailer->XMailer = ' ';
            // if sending over smtp, define the settings for the smpt server
            if ($this->isSMTP) {
                if ($this->debug) {
                    $this->_mailer->SMTPDebug = 2;
                }
                $this->_mailer->isSMTP();
                $this->_mailer->SMTPSecure = $this->smtpSecure;
                $this->_mailer->Host = $this->host;
                $this->_mailer->SMTPAuth= $this->smtpAuth;
                $this->_mailer->Username = $this->username;
                $this->_mailer->Password = $this->password;
                $this->_mailer->Port = $this->port;
                $this->_mailer->SMTPOptions = [
                    'ssl' => ['verify_peer' => false, 'verify_peer_name' => false, 'allow_self_signed' => true],
                ];
            }
        }

        return $this->_mailer;
    }
486610
public function send()
    {
        $smtpServer = $this->config->get('phpci.email_settings.smtp_address');

        if (empty($smtpServer)) {
            return $this->sendViaMail();
        } else {
            return $this->sendViaSwiftMailer();
        }
    }
1329489
public function getPayer()
    {
        $payer = $this->data['address_name'] . '/' . $this->data['payer_email'];
        $charset = strtoupper(str_replace("_", "-", $this->data['charset']));
        if ($charset !== 'UTF-8') {
            $payer = iconv($charset, 'UTF-8//IGNORE', $payer);
        }

        return $payer;
    }
83674
public function getLoader()
    {
        if (null === $this->loader) {
            if (strpos('@PHP-BIN@', '@PHP-BIN') === 0) {
                $base = dirname(__FILE__) . '/';
                set_include_path($base . PATH_SEPARATOR . get_include_path());
            } else {
                $base = '@PEAR-DIR@/Phrozn/';
            }

            //Autoload candidates.
            $dirs = array($base . '..', getcwd());

            foreach ($dirs as $dir) {
                $file = $dir . '/vendor/autoload.php';
                if (file_exists($file)) {
                    $this->loader = include $file;
                    break;
                }
            }

            if (null === $this->loader) {
                throw new \RuntimeException("Unable to locate autoloader.");
            }
        }

        return $this->loader;
    }
499464
protected function emailFactory()
    {
        if (!isset($this->emailFactory)) {
            throw new RuntimeException(sprintf(
                'Email Factory is not defined for [%s]',
                get_class($this)
            ));
        }

        return $this->emailFactory;
    }
1228166
public function clear()
    {
        $this->mailer = null;
        $this->to = $this->attachemnts = array();
        $this->subject = $this->message = false;
        return $this;
    }
828319
protected function registerContactMailer()
    {
        $this->app->bind('contact.mailer', function ($app) {
            $mail = $app['mailer'];
            $home = $app['url']->to('/');
            $path = $app['config']['contact.path'];
            $email = $app['config']['contact.email'];
            $name = $app['config']['app.name'];

            return new Mailer($mail, $home, $path, $email, $name);
        });

        $this->app->alias('contact.mailer', Mailer::class);
    }
1121016
public function getMailInstance($config = null)
    {
        if (!$config) {
            $config = $this->config('config');
        }

        $sender = Configure::read('CM.Mail.sender');

        $object = $this->EmailObject;

        $object->sender($sender['email'], $sender['name']);

        if (Configure::read('CM.Mail.transport')) {
            $object->transport(Configure::read('CM.Mail.transport'));
        }

        return $object;
    }
1244477
public function getDispatcher()
    {
        if (!$this->dispatcher) {
            $this->dispatcher = new \wf\app\web\Dispatcher($this);
        }

        return $this->dispatcher;
    }
39932
public function email()
    {
        $this->raw();

        $email = null;
        $person = $this->person();

        if (isset($person->emails)) {
            if (isset($person->emails->email)) {
                if (is_array($person->emails->email) && isset($person->emails->email[0])) {
                    $email = $person->emails->email[0]->value;
                }
            }
        }

        return $email;
    }
181665
protected static function mailer($key = 'Default')
    {
        if (isset(self::$mailerInstances[$key])) {
            return self::$mailerInstances[$key];
        } else {
            self::$mailerInstances[$key] = new Mailer($key);

            return self::$mailerInstances[$key];
        }
    }
2985
public function envoyer() {
        $this->setEntete();
        return mail($this->destinataire_email, $this->sujet, $this->message, $this->entete);
    }
139849
public function getIterator()
    {
        if (!is_null($this->iterator)) {
            return $this->iterator;
        }

        return $this->iterator = new ArrayIterator((array) $this->value);
    }
592841
private function getLoader(): LoaderInterface
    {
        if (null !== $this->loader) {
            return $this->loader;
        }

        if (null !== $this->localFile) {
            $this->loader = new Local($this->localFile);

            return $this->loader;
        }

        if (extension_loaded('curl')) {
            $this->loader = new Curl($this);

            return $this->loader;
        }

        $streamHelper = new StreamCreator($this);

        if (ini_get('allow_url_fopen')) {
            $this->loader = new FopenLoader($this, $streamHelper);

            return $this->loader;
        }

        $this->loader = new SocketLoader($this, $streamHelper);

        return $this->loader;
    }
215552
public function mailer($phpMailer)
    {
        if (MAILER_SMTP) {
            $phpMailer->isSMTP();
            $phpMailer->SMTPAuth = true;
        }
        $phpMailer->Host = MAILER_HOST;
        $phpMailer->Port = MAILER_PORT;
        $phpMailer->Username = MAILER_USERNAME;
        $phpMailer->Password = MAILER_PASSWORD;
        $phpMailer->SMTPSecure = MAILER_TRANSPORT;
        $phpMailer->Sender = $phpMailer->From;
    }
1350329
public static function fromConfig()
	{
		$mailer = self::getInstance();

		$services = Config::get ('mailer.services');

		if (!$services) {
			return $mailer;
		}

		foreach ($services as $k => $v) {
			$service = MapperFactory::getServiceMapper()->getFromToken($k);
			if ($service) {
				$service->setFromConfig ($v);
				$mailer->addService ($service);
			}
		}

		return $mailer;
	}
148636
public function getAccountManager()
    {
        if (null === $this->accountManager) {
            $this->accountManager = new AccountManager($this->httpClient, $this->messageFactory, $this->serializer);
            $this->accountManager->setHost($this->host);
        }
        return $this->accountManager;
    }