Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1. Mở file \libraries\SEmail.php thêm hàm mới như sau:
- function send_smtp($address_to, $subject, $htmlcontent, $plaincontent = "", $attachment = array()) {
- global $admin_name, $admin_email;
- $PHPMailer = new PHPMailer;
- $PHPMailer->IsSMTP(); // telling the class to use SMTP
- $PHPMailer->SMTPDebug = 0; // enables SMTP debug information (for testing)
- // 1 = errors and messages
- // 2 = messages only
- $PHPMailer->SMTPAuth = true; // enable SMTP authentication
- //$PHPMailer->SMTPSecure = 'ssl'; // secure transfer enabled REQUIRED for GMail
- $PHPMailer->Host = "smtp.domain.com"; // sets the SMTP server
- //$PHPMailer->Port = 465; // set the SMTP port for the GMAIL server
- $PHPMailer->Username = "email address"; // SMTP account username
- $PHPMailer->Password = "password"; // SMTP account password
- $PHPMailer->From = $admin_email;
- $PHPMailer->FromName = $admin_name;
- $PHPMailer->ClearAllRecipients();
- $PHPMailer->AddAddress($address_to);
- $PHPMailer->Subject = $subject;
- $PHPMailer->Body = $htmlcontent;
- $PHPMailer->AltBody = $plaincontent;
- $PHPMailer->IsHTML(true);
- while (list($k, $v) = each($attachment)) {
- $PHPMailer->AddAttachment($v['file'], $v['nickname']);
- }
- $status = @$PHPMailer->Send();
- $PHPMailer->ClearAddresses();
- $PHPMailer->ClearAttachments();
- return $status;
- }
- 2. Mở file \include\functions\main.php
- Tìm function mailme và comment hàm này lại thay bằng hàm mới như sau:
- function mailme($sendto, $sendername, $from, $subject, $sendmailbody, $bcc = "") {
- $subject = nl2br($subject);
- $sendmailbody = nl2br($sendmailbody);
- SEmail::send_smtp($sendto, $subject, $sendmailbody);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement