diff --git a/app/Config/Email.php b/app/Config/Email.php index 729e8957f9ab..01350186a3e9 100644 --- a/app/Config/Email.php +++ b/app/Config/Email.php @@ -6,9 +6,9 @@ class Email extends BaseConfig { - public string $fromEmail; - public string $fromName; - public string $recipients; + public string $fromEmail = ''; + public string $fromName = ''; + public string $recipients = ''; /** * The "user agent" @@ -28,17 +28,17 @@ class Email extends BaseConfig /** * SMTP Server Address */ - public string $SMTPHost; + public string $SMTPHost = ''; /** * SMTP Username */ - public string $SMTPUser; + public string $SMTPUser = ''; /** * SMTP Password */ - public string $SMTPPass; + public string $SMTPPass = ''; /** * SMTP Port diff --git a/system/Email/Email.php b/system/Email/Email.php index d113398d5dab..488a5ee76f04 100644 --- a/system/Email/Email.php +++ b/system/Email/Email.php @@ -1539,7 +1539,11 @@ public function send($autoClear = true) $this->setReplyTo($this->headers['From']); } - if (empty($this->recipients) && ! isset($this->headers['To']) && empty($this->BCCArray) && ! isset($this->headers['Bcc']) && ! isset($this->headers['Cc'])) { + if ( + empty($this->recipients) && ! isset($this->headers['To']) + && empty($this->BCCArray) && ! isset($this->headers['Bcc']) + && ! isset($this->headers['Cc']) + ) { $this->setErrorMessage(lang('Email.noRecipients')); return false;