13 include_once
"Services/Mail/classes/class.ilMail.php";
36 if(empty($this->mail_data))
40 # debug($this->mail_data["m_message"]);
41 $bodylines = explode(chr(13).chr(10), $this->mail_data[
"m_message"]);
42 # var_dump("<pre>",$bodylines,"</pre");
43 for ($i = 0; $i < count($bodylines); $i++)
45 $bodylines[$i] =
"> ".$bodylines[$i];
47 return $this->mail_data[
"m_message"] = implode(chr(13).chr(10), $bodylines);
57 if(empty($this->mail_data))
61 return $this->mail_data[
"m_subject"] =
"RE: ".$this->mail_data[
"m_subject"];
73 if(empty($this->mail_data))
80 foreach (explode(
',', $this->mail_data[
'rcp_to']) as $to)
82 if (trim($to) !=
'' && $ilUser->getLogin() != trim($to))
88 foreach (explode(
',', $this->mail_data[
'rcp_cc']) as $cc)
90 if (trim($cc) !=
'' && $ilUser->getLogin() != trim($cc))
96 return ($this->mail_data[
'rcp_cc'] = implode(
', ', $newCC));
106 if(empty($this->mail_data))
111 require_once
'./Services/User/classes/class.ilObjUser.php';
113 $user =
new ilObjUser($this->mail_data[
"sender_id"]);
114 return $this->mail_data[
"rcp_to"] = $user->getLogin();
123 if(empty($this->mail_data))
127 return $this->mail_data[
"m_subject"] =
"[FWD: ".$this->mail_data[
"m_subject"].
"]";
139 if(empty($this->mail_data))
143 $name_str = implode(
',',$a_names);
147 $this->mail_data[
"rcp_to"] = trim($this->mail_data[
"rcp_to"]);
148 if($this->mail_data[
"rcp_to"])
150 $this->mail_data[
"rcp_to"] = $this->mail_data[
"rcp_to"].
",";
152 $this->mail_data[
"rcp_to"] = $this->mail_data[
"rcp_to"] . $name_str;
156 $this->mail_data[
"rcp_cc"] = trim($this->mail_data[
"rcp_cc"]);
157 if($this->mail_data[
"rcp_cc"])
159 $this->mail_data[
"rcp_cc"] = $this->mail_data[
"rcp_cc"].
",";
161 $this->mail_data[
"rcp_cc"] = $this->mail_data[
"rcp_cc"] . $name_str;
165 $this->mail_data[
"rcp_bcc"] = trim($this->mail_data[
"rcp_bcc"]);
166 if($this->mail_data[
"rcp_bcc"])
168 $this->mail_data[
"rcp_bcc"] = $this->mail_data[
"rcp_bcc"].
",";
170 $this->mail_data[
"rcp_bcc"] = $this->mail_data[
"rcp_bcc"] . $name_str;
184 $formatted = array();
187 $linebreak = $this->mail_options->getLinebreak();
189 $lines = explode(chr(10),$a_message);
190 for($i=0;$i<count($lines);$i++)
192 if(substr($lines[$i],0,1) !=
'>')
194 $formatted[] = wordwrap($lines[$i],$linebreak,chr(10));
198 $formatted[] = $lines[$i];
201 $formatted = implode(chr(10),$formatted);
215 return $this->mail_data[
"m_message"] .= chr(13).chr(10).$this->mail_options->getSignature();