101            throw new \InvalidArgumentException(\sprintf(
 
  102                "The passed argument must be null or of type 'ilMailMimeTransport', %s given!",
 
  107        self::$defaultTransport = $transport;
 
  126            require_once 
'Services/Mail/classes/class.ilMail.php';
 
  156    public function To($to)
 
  161            $this->sendto[] = $to;
 
  169    public function Cc($cc)
 
  184        if (is_array($bcc)) {
 
  187            $this->abcc[] = $bcc;
 
  254    public function Attach(
$filename, $file_type = 
'', $disposition = 
'inline', $display_name = 
null)
 
  256        if ($file_type == 
'') {
 
  257            $file_type = 
'application/octet-stream';
 
  261        $this->actype[] = $file_type;
 
  262        $this->adispo[] = $disposition;
 
  263        $this->adisplay[] = $display_name;
 
  271        $attachments = array();
 
  274        foreach ($this->aattach as $attachment) {
 
  276            if (isset($this->adisplay[
$i]) && strlen($this->adisplay[
$i]) > 0) {
 
  280            $attachments[] = array(
 
  281                'path' => $attachment,
 
  295        return array_values($this->images);
 
  305        $this->finalBodyAlt = 
'';
 
  306        $this->finalBody = 
'';
 
  307        $this->images = array();
 
  309        if (
$DIC->settings()->get(
'mail_send_html', 0)) {
 
  310            $skin = 
$DIC[
'ilClientIniFile']->readVariable(
'layout', 
'skin');
 
  324        if (0 == strlen($this->body)) {
 
  328        if (strip_tags($this->body, 
'<b><u><i><a>') == $this->body) {
 
  334            $this->finalBodyAlt = strip_tags(str_ireplace(array(
"<br />", 
"<br>", 
"<br/>"), 
"\n", $this->body));
 
  337        $this->finalBody = str_replace(
'{PLACEHOLDER}', $this->body, $this->
getHtmlEnvelope($skin));
 
  346        $bracket_path = 
'./Services/Mail/templates/default/tpl.html_mail_template.html';
 
  348        if ($skin != 
'default') {
 
  349            $tplpath = 
'./Customizing/global/skin/' . $skin . 
'/Services/Mail/tpl.html_mail_template.html';
 
  351            if (file_exists($tplpath)) {
 
  352                $bracket_path = 
'./Customizing/global/skin/' . $skin . 
'/Services/Mail/tpl.html_mail_template.html';
 
  356        return file_get_contents($bracket_path);
 
  364        $this->gatherImagesFromDirectory(
'./Services/Mail/templates/default/img');
 
  366        if ($skin != 
'default') {
 
  367            $skinDirectory = 
'./Customizing/global/skin/' . $skin . 
'/Services/Mail/img';
 
  368            if (is_dir($skinDirectory) && is_readable($skinDirectory)) {
 
  369                $this->gatherImagesFromDirectory($skinDirectory, 
true);
 
  378    protected function gatherImagesFromDirectory($directory, $clearPrevious = 
false)
 
  380        if ($clearPrevious) {
 
  381            $this->images = array();
 
  384        foreach (
new \RegexIterator(
new \DirectoryIterator($directory), 
'/\.(jpg|svg|png)$/i') as $file) {
 
  388            $cid = 
'img/' . $file->getFilename();
 
  390            $this->images[$cid] = array(
 
  391                'path' => $file->getPathname(),
 
  393                'name' => $file->getFilename()
 
  410        return $transport->send($this);
 
An exception for terminatinating execution or to throw for unit testing.
static getSubjectPrefix()
Get text that will be prepended to auto generated mails.
Send(\ilMailMimeTransport $transport=null)
build()
Build the relevant email data.
buildHtmlInlineImages($skin)
Cc($cc)
Set the cc mail recipient.
static getDefaultTransport()
To($to)
Set the mail recipient.
Bcc($bcc)
Set the bcc mail recipient.
Subject($subject, $a_add_prefix=false)
__construct()
ilMimeMail constructor.
static setDefaultTransport($transport)
From(ilMailMimeSender $sender)
Attach($filename, $file_type='', $disposition='inline', $display_name=null)
Attach a file to the mail.
static makeClickable($a_text, $detectGotoLinks=false)
makeClickable In Texten enthaltene URLs und Mail-Adressen klickbar machen
Interface ilMailMimeTransport.
Interface ilMailMimeTransport.