mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-02-02 08:56:48 +01:00
Aggiunto test SMTP
This commit is contained in:
parent
3b73c25c0b
commit
6986a6ca99
@ -65,6 +65,13 @@ switch (post('op')) {
|
||||
}
|
||||
}
|
||||
|
||||
$mail = new Mail($id_record);
|
||||
if ($mail->testSMTP()) {
|
||||
$_SESSION['infos'][] = tr('Connessione SMTP riuscita');
|
||||
} else {
|
||||
$_SESSION['errors'][] = tr('Connessione SMTP non riuscita');
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 'delete':
|
||||
|
11
src/Mail.php
11
src/Mail.php
@ -222,4 +222,15 @@ class Mail extends PHPMailer\PHPMailer\PHPMailer
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function testSMTP()
|
||||
{
|
||||
if ($this->IsSMTP() && $this->smtpConnect()) {
|
||||
$this->smtpClose();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user