changes to sms packages and option to create user
This commit is contained in:
@@ -75,7 +75,8 @@ protected function performSmtpAuthTest(MailProfile $profile): void
|
||||
}
|
||||
|
||||
$remote = ($encryption === 'ssl') ? 'ssl://'.$host : $host;
|
||||
$errno = 0; $errstr = '';
|
||||
$errno = 0;
|
||||
$errstr = '';
|
||||
$socket = @fsockopen($remote, $port, $errno, $errstr, 15);
|
||||
if (! $socket) {
|
||||
throw new \RuntimeException("Connect failed: $errstr ($errno)");
|
||||
@@ -104,7 +105,9 @@ protected function performSmtpAuthTest(MailProfile $profile): void
|
||||
// Cleanly quit
|
||||
$this->command($socket, "QUIT\r\n", [221], 'QUIT');
|
||||
} finally {
|
||||
try { fclose($socket); } catch (\Throwable) {
|
||||
try {
|
||||
fclose($socket);
|
||||
} catch (\Throwable) {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
@@ -116,6 +119,7 @@ protected function performSmtpAuthTest(MailProfile $profile): void
|
||||
protected function command($socket, string $cmd, array $expect, string $context): string
|
||||
{
|
||||
fwrite($socket, $cmd);
|
||||
|
||||
return $this->expect($socket, $expect, $context);
|
||||
}
|
||||
|
||||
@@ -138,6 +142,7 @@ protected function expect($socket, array $expectedCodes, string $context): strin
|
||||
if (! in_array($code, $expectedCodes, true)) {
|
||||
throw new \RuntimeException("Unexpected SMTP code $code during $context: ".implode(' | ', $lines));
|
||||
}
|
||||
|
||||
return $line;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user