1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47:
<?php
include_once PATH_TO_ROOT . '/kernel/lib/php/phpmailer/src/PHPMailer.php';
class SMTPMailService extends AbstractPHPMailerMailService
{
private $configuration;
public function __construct(SMTPConfiguration $configuration)
{
$this->configuration = $configuration;
}
protected function set_send_settings(PHPMailer\PHPMailer\PHPMailer $mailer)
{
$mailer->IsSMTP();
$mailer->SMTPDebug = 0;
$mailer->SMTPAuth = true;
$mailer->Timeout = 1;
$auth_mode = $this->configuration->get_auth_mode();
if (!empty($auth_mode))
{
$mailer->SMTPSecure = $this->configuration->get_auth_mode();
}
$mailer->Host = $this->configuration->get_host();
$mailer->Port = $this->configuration->get_port();
$mailer->Username = $this->configuration->get_login();
$mailer->Password = $this->configuration->get_password();
}
}
?>