mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Gracefully fall back when smtp configuration is incorrect
This commit is contained in:
parent
7a128ecb10
commit
a31cd1c407
@ -363,7 +363,7 @@ nlog("nn");
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function configureSmtpMailer(): void
|
private function configureSmtpMailer()
|
||||||
{
|
{
|
||||||
|
|
||||||
$company = $this->company;
|
$company = $this->company;
|
||||||
@ -376,6 +376,16 @@ nlog("nn");
|
|||||||
$smtp_local_domain = strlen($company->smtp_local_domain) > 2 ? $company->smtp_local_domain : null;
|
$smtp_local_domain = strlen($company->smtp_local_domain) > 2 ? $company->smtp_local_domain : null;
|
||||||
$smtp_verify_peer = $company->smtp_verify_peer ?? true;
|
$smtp_verify_peer = $company->smtp_verify_peer ?? true;
|
||||||
|
|
||||||
|
if(strlen($smtp_host ?? '') <= 1 ||
|
||||||
|
strlen($smtp_username ?? '') <= 1 ||
|
||||||
|
strlen($smtp_password ?? '') <= 1
|
||||||
|
)
|
||||||
|
{
|
||||||
|
$this->nmo->settings->email_sending_method = 'default';
|
||||||
|
return $this->setMailDriver();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
config([
|
config([
|
||||||
'mail.mailers.smtp' => [
|
'mail.mailers.smtp' => [
|
||||||
'transport' => 'smtp',
|
'transport' => 'smtp',
|
||||||
|
@ -589,7 +589,7 @@ $this->entityEmailFailed($message);
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function configureSmtpMailer(): void
|
private function configureSmtpMailer()
|
||||||
{
|
{
|
||||||
|
|
||||||
$company = $this->company;
|
$company = $this->company;
|
||||||
@ -602,6 +602,14 @@ $this->entityEmailFailed($message);
|
|||||||
$smtp_local_domain = strlen($company->smtp_local_domain) > 2 ? $company->smtp_local_domain : null;
|
$smtp_local_domain = strlen($company->smtp_local_domain) > 2 ? $company->smtp_local_domain : null;
|
||||||
$smtp_verify_peer = $company->smtp_verify_peer ?? true;
|
$smtp_verify_peer = $company->smtp_verify_peer ?? true;
|
||||||
|
|
||||||
|
if(strlen($smtp_host ?? '') <= 1 ||
|
||||||
|
strlen($smtp_username ?? '') <= 1 ||
|
||||||
|
strlen($smtp_password ?? '') <= 1
|
||||||
|
) {
|
||||||
|
$this->email_object->settings->email_sending_method = 'default';
|
||||||
|
return $this->setMailDriver();
|
||||||
|
}
|
||||||
|
|
||||||
config([
|
config([
|
||||||
'mail.mailers.smtp' => [
|
'mail.mailers.smtp' => [
|
||||||
'transport' => 'smtp',
|
'transport' => 'smtp',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user