config = new Config(); $this->email = new Email(); } // функция отправки email public function send($template, $to, $data, $from = ""){ if($from == "") $from = $this->config->adm_email; $data['sitename'] = $this->config->sitename; $message = $this->email->getText($template); $subject = $this->email->getTitle($template); foreach($data as $key => $value){ $message = str_replace("%$key%", $value, $message); $subject = str_replace("%$key%", $value, $subject); } $subject = '=?utf-8?B?'.base64_encode($subject).'?='; $headers = "From: $from \r\n\ Reply-To: $from \r\n\ Content-type: text/html; charset=utf-8\r\n\ "; return mail($to, $subject, $message, $headers); } } ?>