diff --git a/server/libs/MailSender.php b/server/libs/MailSender.php index 67cedd7b..5802ffb9 100755 --- a/server/libs/MailSender.php +++ b/server/libs/MailSender.php @@ -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' => [