Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions system/Email/Email.php
Original file line number Diff line number Diff line change
Expand Up @@ -2036,15 +2036,15 @@ protected function SMTPAuthenticate()
$this->SMTPAuthMethod = strtolower($this->SMTPAuthMethod);

// Validate supported authentication methods
$validMethods = ['login', 'plain'];
if (! in_array($this->SMTPAuthMethod, $validMethods, true)) {
if (! in_array($this->SMTPAuthMethod, ['login', 'plain'], true)) {
$this->setErrorMessage(lang('Email.invalidSMTPAuthMethod', [$this->SMTPAuthMethod]));

return false;
}

$upperAuthMethod = strtoupper($this->SMTPAuthMethod);
// send initial 'AUTH' command
$this->sendData('AUTH ' . strtoupper($this->SMTPAuthMethod));
$this->sendData('AUTH ' . $upperAuthMethod);
$reply = $this->getSMTPData();

if (str_starts_with($reply, '503')) { // Already authenticated
Expand All @@ -2053,7 +2053,7 @@ protected function SMTPAuthenticate()

// if 'AUTH' command is unsuported by the server
if (! str_starts_with($reply, '334')) {
$this->setErrorMessage(lang('Email.failureSMTPAuthMethod', [strtoupper($this->SMTPAuthMethod)]));
$this->setErrorMessage(lang('Email.failureSMTPAuthMethod', [$upperAuthMethod]));

return false;
}
Expand Down
Loading