/**
  * Sends an mail with the error messages.
  *
  * The receiver and the sender is set in the suite settings.
  *
  * @return $this|TestSuite Same instance for chained method calls.
  */
 private function _sendErrorMail()
 {
     $from = $this->suiteSettings->getSendMailFrom();
     $to = $this->suiteSettings->getSendMailTo();
     $reply = $this->suiteSettings->getSendMailReplyTo();
     if ($to === '' || $reply === '' || $from === '') {
         $this->output('Invalid E-Mail credentials, not possible to send the error mail');
         return $this;
     }
     $subject = '[SeleniumTest] Test fehlgeschlagen, Branch: ' . $this->suiteSettings->getBranch();
     $header = 'From: ' . $from . "\r\n" . 'Reply-To: ' . $reply . "\r\n" . 'Content-Type: text/plain; charset=UTF-8"';
     mail($to, $subject, $this->errorMessages, $header);
     $this->output('Error E-Mail send!');
     $this->errorMailSend = true;
     return $this;
 }