Skip to content

Commit bb5c477

Browse files
authored
Merge pull request #7078 from kenjis/fix-Email-Config-env
fix: Email config in the .env doesn't appear as expected
2 parents ed25a2c + 97736e2 commit bb5c477

2 files changed

Lines changed: 11 additions & 7 deletions

File tree

app/Config/Email.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66

77
class Email extends BaseConfig
88
{
9-
public string $fromEmail;
10-
public string $fromName;
11-
public string $recipients;
9+
public string $fromEmail = '';
10+
public string $fromName = '';
11+
public string $recipients = '';
1212

1313
/**
1414
* The "user agent"
@@ -28,17 +28,17 @@ class Email extends BaseConfig
2828
/**
2929
* SMTP Server Address
3030
*/
31-
public string $SMTPHost;
31+
public string $SMTPHost = '';
3232

3333
/**
3434
* SMTP Username
3535
*/
36-
public string $SMTPUser;
36+
public string $SMTPUser = '';
3737

3838
/**
3939
* SMTP Password
4040
*/
41-
public string $SMTPPass;
41+
public string $SMTPPass = '';
4242

4343
/**
4444
* SMTP Port

system/Email/Email.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1539,7 +1539,11 @@ public function send($autoClear = true)
15391539
$this->setReplyTo($this->headers['From']);
15401540
}
15411541

1542-
if (empty($this->recipients) && ! isset($this->headers['To']) && empty($this->BCCArray) && ! isset($this->headers['Bcc']) && ! isset($this->headers['Cc'])) {
1542+
if (
1543+
empty($this->recipients) && ! isset($this->headers['To'])
1544+
&& empty($this->BCCArray) && ! isset($this->headers['Bcc'])
1545+
&& ! isset($this->headers['Cc'])
1546+
) {
15431547
$this->setErrorMessage(lang('Email.noRecipients'));
15441548

15451549
return false;

0 commit comments

Comments
 (0)