ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilMailMimeTransportFactory.php
Go to the documentation of this file.
1 <?php declare(strict_types=1);
2 
3 /* Copyright (c) 1998-2017 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
6 {
8  protected $settings;
9 
11  private $eventHandler;
12 
19  {
20  $this->settings = $settings;
21  $this->eventHandler = $eventHandler;
22  }
23 
27  public function getTransport() : ilMailMimeTransport
28  {
29  if (!(bool) $this->settings->get('mail_allow_external')) {
30  return new ilMailMimeTransportNull();
31  }
32 
33  if ((bool) $this->settings->get('mail_smtp_status')) {
34  return new ilMailMimeTransportSmtp($this->settings, $this->eventHandler);
35  }
36 
37  return new ilMailMimeTransportSendmail($this->settings, $this->eventHandler);
38  }
39 }
Global event handler.
settings()
Definition: settings.php:2
__construct(ilSetting $settings, ilAppEventHandler $eventHandler)
ilMailMimeTransportFactory constructor.
Class ilMailMimeTransportSmtp.
Class ilMailMimeTransportNull.
Interface ilMailMimeTransport.
Class ilMailMimeTransportSendmail.