mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-02-16 19:40:44 +01:00
Fix per test connessione al server SMTP
This commit is contained in:
parent
c11c5f0fa5
commit
6315861a07
@ -66,11 +66,15 @@ 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');
|
||||
}
|
||||
if (!empty((array)$mail)){
|
||||
if ($mail->testSMTP()) {
|
||||
$_SESSION['infos'][] = tr('Connessione SMTP riuscita');
|
||||
} else {
|
||||
$_SESSION['errors'][] = tr('Connessione SMTP non riuscita');
|
||||
}
|
||||
}else{
|
||||
$_SESSION['errors'][] = tr('Errore.');
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
|
12
src/Mail.php
12
src/Mail.php
@ -224,15 +224,19 @@ class Mail extends PHPMailer\PHPMailer\PHPMailer
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Testa la connessione al server SMTP
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function testSMTP()
|
||||
{
|
||||
if ($this->IsSMTP() && $this->smtpConnect()) {
|
||||
if ($this->smtpConnect()) {
|
||||
$this->smtpClose();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user