/**
  * Sends an email. In most cases this mail was generated using the form
  * provided by actionMailForm
  *
  * @return string
  * @since 3.4
  * @permissions view
  */
 protected function actionSendMail()
 {
     $objForm = $this->getMailForm();
     if (!$objForm->validateForm()) {
         return $this->actionMailForm($objForm);
     }
     $this->setArrModuleEntry("template", "/folderview.tpl");
     $objUser = new class_module_user_user($this->objSession->getUserID());
     //mail or internal message?
     $objMailValidator = new class_email_validator();
     $objEmail = new class_mail();
     $objEmail->setSender($objUser->getStrEmail());
     $arrRecipients = explode(",", $this->getParam("mail_recipient"));
     foreach ($arrRecipients as $strOneRecipient) {
         if ($objMailValidator->validate($strOneRecipient)) {
             $objEmail->addTo($strOneRecipient);
         }
     }
     if ($objForm->getField("mail_cc")->getStrValue() != "") {
         $objUser = new class_module_user_user($objForm->getField("mail_cc")->getStrValue());
         $objEmail->addCc($objUser->getStrEmail());
     }
     $objEmail->setSubject($objForm->getField("mail_subject")->getStrValue());
     $objEmail->setText($objForm->getField("mail_body")->getStrValue());
     if ($objEmail->sendMail()) {
         return $this->getLang("mail_send_success");
     } else {
         return $this->getLang("mail_send_error");
     }
 }