<?php
 use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\SMTP; class vB_Mail_Transport_PhpMailer_Smtp extends vB_Mail_Transport_PhpMailer { protected function createPhpMailer() : PHPMailer { $vboptions = vB::getDatastore()->getValue('options'); $mailer = parent::createPhpMailer(); $mailer->isSMTP(); $mailer->Port = $vboptions['smtp_port'] ?: $this->defaultSmtpPort[$vboptions['smtp_tls']] ?? $this->defaultSmtpPort['none']; $mailer->SMTPSecure = $this->smtpSecureMap[$vboptions['smtp_tls']] ?? $this->smtpSecureMap['none']; $mailer->Host = $vboptions['smtp_host']; $mailer->SMTPAuth = false; if ($vboptions['smtp_user']) { $mailer->Username = $vboptions['smtp_user']; $mailer->Password = $vboptions['smtp_pass']; $mailer->SMTPAuth = true; } return $mailer; } } 