1
|
|
|
<?php |
2
|
|
|
require_once('/var/www/common/libs/PHPMailer/PHPMailerAutoload.php'); |
3
|
|
|
require_once('/var/www/secure_settings/class.FlipsideSettings.php'); |
4
|
|
|
class FlipsideMail extends PHPMailer |
5
|
|
|
{ |
6
|
|
|
public function __construct() |
7
|
|
|
{ |
8
|
|
|
parent::__construct(); |
9
|
|
|
$this->isSMTP(); |
10
|
|
|
$this->SMTPAuth = true; |
11
|
|
|
$this->Host = FlipsideSettings::$smtp['smtp_host']; |
12
|
|
|
$this->Username = FlipsideSettings::$smtp['smtp_user']; |
13
|
|
|
$this->Password = FlipsideSettings::$smtp['smtp_pass']; |
14
|
|
|
$this->SMTPSecure = FlipsideSettings::$smtp['smtp_proto']; |
15
|
|
|
$this->Port = FlipsideSettings::$smtp['smtp_port']; |
16
|
|
|
} |
17
|
|
|
|
18
|
|
|
private static function add_to($item1, $key, $mail) |
|
|
|
|
19
|
|
|
{ |
20
|
|
|
$mail->addAddress($item1); |
21
|
|
|
} |
22
|
|
|
|
23
|
|
|
public function send_HTML($mail) |
24
|
|
|
{ |
25
|
|
|
if(isset($mail['from'])) |
26
|
|
|
{ |
27
|
|
|
$this->From = $mail['from']; |
28
|
|
|
} |
29
|
|
|
else |
30
|
|
|
{ |
31
|
|
|
$this->From = $this->Username; |
32
|
|
|
} |
33
|
|
|
if(isset($mail['from_name'])) |
34
|
|
|
{ |
35
|
|
|
$this->FromName = $mail['from_name']; |
36
|
|
|
} |
37
|
|
|
else |
38
|
|
|
{ |
39
|
|
|
$this->FromName = 'Burning Flipside'; |
40
|
|
|
} |
41
|
|
|
$this->clearAllRecipients(); |
42
|
|
|
if(is_array($mail['to'])) |
43
|
|
|
{ |
44
|
|
|
array_walk($mail['to'], 'FlipsideMail::addTo', $this); |
45
|
|
|
} |
46
|
|
|
else |
47
|
|
|
{ |
48
|
|
|
$this->addAddress($mail['to']); |
49
|
|
|
} |
50
|
|
|
if(isset($mail['reply_to'])) |
51
|
|
|
{ |
52
|
|
|
$this->addReplyTo($mail['reply_to']); |
53
|
|
|
} |
54
|
|
|
$this->isHTML(true); |
55
|
|
|
|
56
|
|
|
$this->Subject = $mail['subject']; |
57
|
|
|
$this->Body = $mail['body']; |
58
|
|
|
$this->AltBody = $mail['alt_body']; |
59
|
|
|
|
60
|
|
|
return $this->send(); |
61
|
|
|
} |
62
|
|
|
} |
63
|
|
|
?> |
|
|
|
|
64
|
|
|
|