34 include_once
"Services/Mail/classes/class.ilMail.php";
57 if(empty($this->mail_data))
61 # debug($this->mail_data["m_message"]);
62 $bodylines = explode(chr(13).chr(10), $this->mail_data[
"m_message"]);
63 # var_dump("<pre>",$bodylines,"</pre");
64 for ($i = 0; $i < count($bodylines); $i++)
66 $bodylines[$i] =
"> ".$bodylines[$i];
68 return $this->mail_data[
"m_message"] = implode(chr(13).chr(10), $bodylines);
78 if(empty($this->mail_data))
82 return $this->mail_data[
"m_subject"] =
"RE: ".$this->mail_data[
"m_subject"];
94 if(empty($this->mail_data))
101 foreach (explode(
',', $this->mail_data[
'rcp_to']) as $to)
103 if (trim($to) !=
'' && $ilUser->getLogin() != trim($to))
105 $newCC[] = trim($to);
109 foreach (explode(
',', $this->mail_data[
'rcp_cc']) as $cc)
111 if (trim($cc) !=
'' && $ilUser->getLogin() != trim($cc))
113 $newCC[] = trim($cc);
117 return ($this->mail_data[
'rcp_cc'] = implode(
', ', $newCC));
127 if(empty($this->mail_data))
132 require_once
'./Services/User/classes/class.ilObjUser.php';
134 $user =
new ilObjUser($this->mail_data[
"sender_id"]);
135 return $this->mail_data[
"rcp_to"] = $user->getLogin();
144 if(empty($this->mail_data))
148 return $this->mail_data[
"m_subject"] =
"[FWD: ".$this->mail_data[
"m_subject"].
"]";
160 if(empty($this->mail_data))
164 $name_str = implode(
',',$a_names);
168 $this->mail_data[
"rcp_to"] = trim($this->mail_data[
"rcp_to"]);
169 if($this->mail_data[
"rcp_to"])
171 $this->mail_data[
"rcp_to"] = $this->mail_data[
"rcp_to"].
",";
173 $this->mail_data[
"rcp_to"] = $this->mail_data[
"rcp_to"] . $name_str;
177 $this->mail_data[
"rcp_cc"] = trim($this->mail_data[
"rcp_cc"]);
178 if($this->mail_data[
"rcp_cc"])
180 $this->mail_data[
"rcp_cc"] = $this->mail_data[
"rcp_cc"].
",";
182 $this->mail_data[
"rcp_cc"] = $this->mail_data[
"rcp_cc"] . $name_str;
186 $this->mail_data[
"rcp_bcc"] = trim($this->mail_data[
"rcp_bcc"]);
187 if($this->mail_data[
"rcp_bcc"])
189 $this->mail_data[
"rcp_bcc"] = $this->mail_data[
"rcp_bcc"].
",";
191 $this->mail_data[
"rcp_bcc"] = $this->mail_data[
"rcp_bcc"] . $name_str;
205 $formatted = array();
208 $linebreak = $this->mail_options->getLinebreak();
210 $lines = explode(chr(10),$a_message);
211 for($i=0;$i<count($lines);$i++)
213 if(substr($lines[$i],0,1) !=
'>')
215 $formatted[] = wordwrap($lines[$i],$linebreak,chr(10));
219 $formatted[] = $lines[$i];
222 $formatted = implode(chr(10),$formatted);
236 return $this->mail_data[
"m_message"] .= chr(13).chr(10).$this->mail_options->getSignature();