|
|
@ -1,11 +1,11 @@ |
|
|
|
<?php |
|
|
|
/** |
|
|
|
* Класс для отправки мыла |
|
|
|
* Класс для отправки почты |
|
|
|
* |
|
|
|
* @copyright NetMonsters <team@netmonsters.ru> |
|
|
|
* @link |
|
|
|
* @package Nakon |
|
|
|
* @subpackage face |
|
|
|
* @link http://netmonsters.ru |
|
|
|
* @package Core |
|
|
|
* @subpackage mail |
|
|
|
* @since |
|
|
|
* @version SVN: $Id$ |
|
|
|
* @filesource $URL$ |
|
|
@ -17,26 +17,24 @@ class Mailer |
|
|
|
public $template = null; |
|
|
|
public $templater; |
|
|
|
public $headers; |
|
|
|
protected $url; |
|
|
|
protected $host; |
|
|
|
|
|
|
|
function __construct($template = null) |
|
|
|
function __construct($host, $template = null) |
|
|
|
{ |
|
|
|
if ($template !== null) { |
|
|
|
$this->templater = Load::templater(ACTION_TPL_PATH . '/' . $this->template_dir); |
|
|
|
$this->template = $template; |
|
|
|
} |
|
|
|
|
|
|
|
$settings = Env::getParam('site_settings'); |
|
|
|
$this->url = $settings['host_name']; |
|
|
|
$this->host = $host; |
|
|
|
|
|
|
|
/* если че забыл, не серчайте */ |
|
|
|
$this->headers .= 'From: robot@' . $this->url . "\r\n"; |
|
|
|
$this->headers .= 'From: robot@' . $this->host . "\r\n"; |
|
|
|
$this->headers .= 'Date: '. date('r') ."\r\n"; |
|
|
|
$this->headers .= "Return-Path: robot@". $this->url ."\r\n"; |
|
|
|
$this->headers .= "Return-Path: robot@". $this->host ."\r\n"; |
|
|
|
$this->headers .= "X-Mailer: PHPMail Tool\r\n"; |
|
|
|
$this->headers .= "Reply-To: robot@". $this->url ."\r\n"; |
|
|
|
$this->headers .= "Reply-To: robot@". $this->host ."\r\n"; |
|
|
|
$this->headers .= "X-Priority: 3 (Normal)\r\n"; |
|
|
|
$this->headers .= "Message-ID: <". md5(uniqid(time()))."@". $this->url .">\r\n"; |
|
|
|
$this->headers .= "Message-ID: <". md5(uniqid(time()))."@". $this->host .">\r\n"; |
|
|
|
$this->headers .= "MIME-Version: 1.0\r\n"; |
|
|
|
$this->headers .= "Content-Type: text/plain; charset=utf-8\r\n"; |
|
|
|
$this->headers .= "Content-Transfer-Encoding: 16bit\r\n"; |
|
|
|