This repository was archived by the owner on Jan 24, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPHPMailer.php
More file actions
66 lines (66 loc) · 1.46 KB
/
PHPMailer.php
File metadata and controls
66 lines (66 loc) · 1.46 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?php
namespace RedCat\Identify;
class PHPMailer extends \PHPMailer\PHPMailer\PHPMailer{
function mail($email, $subject, $message, $html=true){
if(is_array($email)){
foreach($email as $k=>$v){
if(is_integer($k))
$this->addAddress($v);
else
$this->addAddress($k,$v);
}
}
else{
$this->addAddress($email);
}
$this->Subject = $subject;
if($html){
if(is_bool($html)){
$this->msgHTML($message);
}
else{
$this->msgHTML($html);
$this->AltBody = $message;
}
}
else{
$this->Body = $message;
}
return $this->send();
}
function __construct(
$fromEmail=null,$fromName=null,
$replyEmail=null,$replyName=null,
$host=null,$port=25,$username=null,$password=null,$secure=null,
$sendmail=null,
$debug=false,$exceptions=false,$SMTPOptions=[]
){
parent::__construct($exceptions);
$this->CharSet = 'UTF-8';
$this->SMTPOptions = $SMTPOptions;
if($host){
$this->isSMTP();
if(isset($debug)){
$this->SMTPDebug = $debug;
if($debug)
$this->Debugoutput = 'html';
}
$this->Host = $host;
$this->Port = $port;
if(isset($username)){
$this->SMTPAuth = true;
if(isset($secure))
$this->SMTPSecure = $secure===true?'tls':$secure;
$this->Username = $username;
$this->Password = $password;
}
}
elseif($sendmail){
$this->isSendmail();
}
if($fromEmail)
$this->setFrom($fromEmail, $fromName);
if($replyEmail)
$this->addReplyTo($replyEmail, $replyName);
}
}