修复后的xml:
<modification>
<id>PHPMailer</id>
<version>2.0</version>
<vqmver>1.0.4</vqmver>
<author>SpotOnSolutions.net</author>
<file name="system/library/mail.php">
<operation>
<search position="before"><![CDATA[
class Mail
]]></search>
<add><![CDATA[include_once(DIR_SYSTEM . 'library/phpmailer/class.phpmailer.php');]]></add>
</operation>
<operation>
<search position="before"><![CDATA[
protected $subject;
]]></search>
<add><![CDATA[ protected $readreceipt;]]></add>
</operation>
<operation>
<search position="before"><![CDATA[
public function setSubject
]]></search>
<add><![CDATA[ public function setReadReceipt($readreceipt) {
$this->readreceipt = $readreceipt;
}
]]></add>
</operation>
<operation>
<search position="before"><![CDATA[public function send() {]]></search>
<add><![CDATA[/*]]></add>
</operation>
<operation>
<search position="bottom" offset="2"><![CDATA[
public function send() {
]]></search>
<add><![CDATA[*/
public function send() {
if (!$this->to) {
trigger_error('Error: E-Mail to required!');
exit();
}
if (!$this->from) {
trigger_error('Error: E-Mail from required!');
exit();
}
if (!$this->sender) {
trigger_error('Error: E-Mail sender required!');
exit();
}
if (!$this->subject) {
trigger_error('Error: E-Mail subject required!');
exit();
}
if ((!$this->text) && (!$this->html)) {
trigger_error('Error: E-Mail message required!');
exit();
}
$mail = new PHPMailer();
$mail->CharSet = "UTF-8";
if (is_array($this->to)) {
foreach ($this->to as $toTmp){
$mail->AddAddress($toTmp);
}
} else {
$mail->AddAddress($this->to);
}
if(!empty($this->readreceipt)) {
$mail->ConfirmReadingTo = $this->readreceipt;
}
$mail->Subject = $this->subject;
$mail->AddReplyTo($this->from, $this->sender);
$mail->SetFrom($this->from, $this->sender);
$mail->AddReplyTo($this->from, $this->sender);
if (!$this->html) {
$mail->Body = $this->text;
} else {
$mail->MsgHTML($this->html);
if ($this->text) {
$mail->AltBody = $this->text;
} else {
$mail->AltBody = 'This is a HTML email and your email client software does not support HTML email!';
}
}
foreach ($this->attachments as $attachment) {
if (file_exists($attachment['file'])) {
$mail->AddAttachment($attachment['file']);
}
}
if ($this->protocol == 'smtp') {
$mail->IsSMTP();
$mail->Host = $this->smtp_hostname;
$mail->Port = $this->smtp_port;
if($this->smtp_port == '587'){
$mail->SMTPAuth = true;
$mail->SMTPSecure = "tls";
} elseif ($this->smtp_port == '465') {
$mail->SMTPAuth = true;
$mail->SMTPSecure = "ssl";
}
if (!empty($this->smtp_username) && !empty($this->smtp_password)) {
$mail->SMTPAuth = true;
$mail->Host = $this->smtp_hostname;
$mail->Username = $this->smtp_username;
$mail->Password = $this->smtp_password;
}
}
$mail->Send();
]]></add>
</operation>
</file>
</modification> (责任编辑:最模板) |