isSMTP(); $this->SMTPAuth = TRUE; } public function configure(MailModule $module) { $this->_module = $module; $config = $module->getConfig(); $this->Host = $config->smtp->host; $this->Port = $config->smtp->port; $this->Username = $config->smtp->user; $this->Password = $config->smtp->pass; if ($config->smtp->tls) { $this->SMTPSecure = 'tls'; } $this->setFrom($config->mail->from, $config->mail->name); if ($config->mail->send_copies) { $this->addBCC($config->mail->from); } } protected function _sendImmediate(string $subject, string $html, string $to, string $name) { $this->addAddress($to, $name); $this->isHTML(TRUE); $this->Subject = $subject; $this->Body = $html; $this->AltBody = strip_tags($html); $result = $this->send(); $this->clearAddresses(); return $result; } public function sendTemplate(MailTemplate $template, string $subject, string $to, string $name) { $html = $template->execute(); if ($template->isImmediate()) { return $this->_sendImmediate($subject, $html, $to, $name); } else { return $this->_module->queueMail($subject, $html, $to, $name); } } } ?>