Loading CHANGELOG.md +5 −0 Original line number Diff line number Diff line 7.2.3 ----- - Bug fixe pour les envoies de mails en smtps 7.2.1 ----- - Bug Fixe pour les actions console Loading src/UnicaenMail/Service/Mail/MailServiceFactory.php +14 −1 Original line number Diff line number Diff line Loading @@ -8,6 +8,7 @@ use Psr\Container\ContainerExceptionInterface; use Psr\Container\NotFoundExceptionInterface; use Symfony\Component\Mailer\Mailer; use Symfony\Component\Mailer\Transport\Smtp\EsmtpTransport; use UnicaenMail\Exception\NotFoundConfigException; class MailServiceFactory { Loading @@ -20,7 +21,19 @@ class MailServiceFactory { public function __invoke(ContainerInterface $container) : MailService { $config = $container->get('Configuration')['unicaen-mail']; $transport = new EsmtpTransport(host: $config['transport_options']['host'], port: $config['transport_options']['port']); $host = ($config['transport_options']['host']) ?? null; $port = ($config['transport_options']['port']) ?? null; $transport = new EsmtpTransport(host: $host, port: $port); if($port==465){ $username = ($config['transport_options']['connection_config']['username']) ?? null; $password = ($config['transport_options']['connection_config']['password']) ?? null; if(!isset($username) || !isset($password)){ throw new NotFoundConfigException("Paramétres d'authentifications non définis"); } $transport->setUsername($username); $transport->setPassword($password); } $mailer = new Mailer($transport); /** Loading Loading
CHANGELOG.md +5 −0 Original line number Diff line number Diff line 7.2.3 ----- - Bug fixe pour les envoies de mails en smtps 7.2.1 ----- - Bug Fixe pour les actions console Loading
src/UnicaenMail/Service/Mail/MailServiceFactory.php +14 −1 Original line number Diff line number Diff line Loading @@ -8,6 +8,7 @@ use Psr\Container\ContainerExceptionInterface; use Psr\Container\NotFoundExceptionInterface; use Symfony\Component\Mailer\Mailer; use Symfony\Component\Mailer\Transport\Smtp\EsmtpTransport; use UnicaenMail\Exception\NotFoundConfigException; class MailServiceFactory { Loading @@ -20,7 +21,19 @@ class MailServiceFactory { public function __invoke(ContainerInterface $container) : MailService { $config = $container->get('Configuration')['unicaen-mail']; $transport = new EsmtpTransport(host: $config['transport_options']['host'], port: $config['transport_options']['port']); $host = ($config['transport_options']['host']) ?? null; $port = ($config['transport_options']['port']) ?? null; $transport = new EsmtpTransport(host: $host, port: $port); if($port==465){ $username = ($config['transport_options']['connection_config']['username']) ?? null; $password = ($config['transport_options']['connection_config']['password']) ?? null; if(!isset($username) || !isset($password)){ throw new NotFoundConfigException("Paramétres d'authentifications non définis"); } $transport->setUsername($username); $transport->setPassword($password); } $mailer = new Mailer($transport); /** Loading