13 include_once
"Services/Mail/classes/class.ilMail.php";
26 parent::__construct($a_user_id);
36 if (empty($this->mail_data)) {
40 $bodylines = preg_split(
"/\r\n|\n|\r/", $this->mail_data[
"m_message"]);
41 for (
$i = 0;
$i < count($bodylines);
$i++) {
42 $bodylines[
$i] =
"> " . $bodylines[
$i];
45 return $this->mail_data[
"m_message"] = implode(chr(10), $bodylines);
55 if (empty($this->mail_data)) {
58 return $this->mail_data[
"m_subject"] =
"RE: " . $this->mail_data[
"m_subject"];
70 if (empty($this->mail_data)) {
76 $currentUserLogin = $DIC->user()->getLogin();
78 foreach (explode(
',', $this->mail_data[
'rcp_to']) as $to) {
79 if (trim($to) !=
'' && $currentUserLogin != trim($to)) {
84 foreach (explode(
',', $this->mail_data[
'rcp_cc']) as $cc) {
85 if (trim($cc) !=
'' && $currentUserLogin != trim($cc)) {
90 return ($this->mail_data[
'rcp_cc'] = implode(
', ', $newCC));
100 if (empty($this->mail_data)) {
104 require_once
'./Services/User/classes/class.ilObjUser.php';
106 $user =
new ilObjUser($this->mail_data[
"sender_id"]);
107 return $this->mail_data[
"rcp_to"] = $user->getLogin();
116 if (empty($this->mail_data)) {
119 return $this->mail_data[
"m_subject"] =
"[FWD: " . $this->mail_data[
"m_subject"] .
"]";
131 if (empty($this->mail_data)) {
134 $name_str = implode(
',', $a_names);
137 $this->mail_data[
"rcp_to"] = trim($this->mail_data[
"rcp_to"]);
138 if ($this->mail_data[
"rcp_to"]) {
139 $this->mail_data[
"rcp_to"] = $this->mail_data[
"rcp_to"] .
",";
141 $this->mail_data[
"rcp_to"] = $this->mail_data[
"rcp_to"] . $name_str;
145 $this->mail_data[
"rcp_cc"] = trim($this->mail_data[
"rcp_cc"]);
146 if ($this->mail_data[
"rcp_cc"]) {
147 $this->mail_data[
"rcp_cc"] = $this->mail_data[
"rcp_cc"] .
",";
149 $this->mail_data[
"rcp_cc"] = $this->mail_data[
"rcp_cc"] . $name_str;
153 $this->mail_data[
"rcp_bcc"] = trim($this->mail_data[
"rcp_bcc"]);
154 if ($this->mail_data[
"rcp_bcc"]) {
155 $this->mail_data[
"rcp_bcc"] = $this->mail_data[
"rcp_bcc"] .
",";
157 $this->mail_data[
"rcp_bcc"] = $this->mail_data[
"rcp_bcc"] . $name_str;
171 $formatted =
array();
173 $linebreak = $this->mail_options->getLinebreak();
175 $lines = explode(chr(10), $a_message);
176 for (
$i=0;
$i<count($lines);
$i++) {
177 if (substr($lines[
$i], 0, 1) !=
'>') {
178 $formatted[] = wordwrap($lines[$i], $linebreak, chr(10));
180 $formatted[] = $lines[
$i];
183 $formatted = implode(chr(10), $formatted);
197 return $this->mail_data[
"m_message"] .= chr(13) . chr(10) . $this->mail_options->getSignature();
205 return $this->mail_options->getSignature() . chr(13) . chr(10) . chr(13) . chr(10) . $this->mail_data[
"m_message"];
This class handles base functions for mail handling.
Create styles array
The data for the language used.