-
Notifications
You must be signed in to change notification settings - Fork 4
/
Mailer.php
40 lines (35 loc) · 843 Bytes
/
Mailer.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
/**
* A mail extension for yii
*
* @link http://github.com/tlikai/YiiMailer
* @author likai<youyuge@gmail.com>
* @license http://www.youyuge.com/license New BSD License
*/
abstract class Mailer extends CApplicationComponent
{
/**
* CRLF
*
* @var string
*/
public $crlf;
public function init()
{
parent::init();
if(defined('PHP_EOL'))
$this->crlf = PHP_EOL;
else
$this->crlf = !strpos(PHP_OS, 'WIN') ? "\n" : "\r\n";
}
public function getHeaders()
{
return array(
'X-Priority: 3',
'X-Mailer: Yii mailer',
'MIME-Version: 1.0',
'Content-type: text/plain; charset=' . Yii::app()->charset,
);
}
abstract public function send($to, $subject, $message);
}