Fix SMTP for servers that don't need auth (#783)

Currently this fails against servers that don't need or support AUTH but rely on other means to allow relaying email.
This commit is contained in:
Bernard Spil 2020-05-13 23:30:47 +02:00 committed by GitHub
parent 1d19d5578b
commit 6fd392bc15
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 3 deletions

View File

@ -66,10 +66,12 @@ class MailSender {
$this->mailerInstance->CharSet = 'UTF-8';
$this->mailerInstance->isSMTP();
$this->mailerInstance->SMTPAuth = true;
$this->mailerInstance->Host = $this->mailOptions['smtp-host'];
$this->mailerInstance->Username = $this->mailOptions['smtp-user'];
$this->mailerInstance->Password = $this->mailOptions['smtp-pass'];
if($this->mailerInstance->Username !== '') {
$this->mailerInstance->SMTPAuth = true;
$this->mailerInstance->Username = $this->mailOptions['smtp-user'];
$this->mailerInstance->Password = $this->mailOptions['smtp-pass'];
}
$this->mailerInstance->Timeout = 10;
$this->mailerInstance->SMTPOptions = [
'ssl' => [