mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-19 00:28:47 +02:00
N°5310 - Mail to ticket: Migration 3.1 - PHPMail
This commit is contained in:
@@ -28,8 +28,10 @@
|
||||
use Combodo\iTop\Core\Authentication\Client\OAuth\OAuthClientProviderFactory;
|
||||
use Laminas\Mail\Header\ContentType;
|
||||
use Laminas\Mail\Message;
|
||||
use Laminas\Mail\Protocol\Smtp\Auth\Oauth;
|
||||
use Laminas\Mail\Transport\File;
|
||||
use Laminas\Mail\Transport\FileOptions;
|
||||
use Laminas\Mail\Transport\Sendmail;
|
||||
use Laminas\Mail\Transport\Smtp;
|
||||
use Laminas\Mail\Transport\SmtpOptions;
|
||||
use Laminas\Mime\Mime;
|
||||
@@ -211,7 +213,7 @@ class EMailLaminas extends Email
|
||||
$oOptions = new SmtpOptions($aOptions);
|
||||
$oTransport->setOptions($oOptions);
|
||||
|
||||
\Laminas\Mail\Protocol\Smtp\Auth\Oauth::setProvider(OAuthClientProviderFactory::GetProviderForSMTP());
|
||||
Oauth::setProvider(OAuthClientProviderFactory::GetProviderForSMTP());
|
||||
break;
|
||||
|
||||
case 'Null':
|
||||
@@ -228,7 +230,7 @@ class EMailLaminas extends Email
|
||||
|
||||
case 'PHPMail':
|
||||
default:
|
||||
$oTransport = new Smtp();
|
||||
$oTransport = new Sendmail();
|
||||
}
|
||||
|
||||
$oKPI = new ExecutionKPI();
|
||||
@@ -240,8 +242,8 @@ class EMailLaminas extends Email
|
||||
return EMAIL_SEND_OK;
|
||||
}
|
||||
catch (Laminas\Mail\Transport\Exception\RuntimeException $e) {
|
||||
IssueLog::Warning('Email sending failed: Some recipients were invalid');
|
||||
$aIssues = array('Some recipients were invalid.');
|
||||
IssueLog::Warning('Email sending failed: '.$e->getMessage());
|
||||
$aIssues = array($e->getMessage());
|
||||
$oKPI->ComputeStats('Email Sent', 'Error received');
|
||||
|
||||
return EMAIL_SEND_ERROR;
|
||||
|
||||
Reference in New Issue
Block a user