ÿØÿà JFIF ` ` ÿþ
|
Server : Apache/2.4.58 (Ubuntu) mod_fcgid/2.3.9 OpenSSL/3.0.13 System : Linux cpanel4.trivietit.net 6.8.0-85-generic #85-Ubuntu SMP PREEMPT_DYNAMIC Thu Sep 18 15:26:59 UTC 2025 x86_64 User : cungcapmhutbui ( 1010) PHP Version : 5.6.40-86+ubuntu24.04.1+deb.sury.org+1 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,exec,system,passthru,shell_exec,proc_open,popen Directory : /home/cungcapmhutbui/web/cungcapmayhutbui.com/public_html/system/application/controllers/ |
Upload File : |
<?php
class mail extends CI_Controller {
public function __construct() {
}
public function demo () {
require_once ROOT_PATH.'/phpmailer/class.phpmailer.php';
$mail = new PHPMailer(); // tạo một đối tượng mới từ class PHPMailer
$mail -> IsSMTP(); // bật chức năng SMTP
$mail -> SMTPDebug =1; // kiểm tra lỗi : 1 là hiển thị lỗi và thông báo cho ta biết, 2 = chỉ thông báo lỗi
$mail -> SMTPAuth = true; // bật chức năng đăng nhập vào SMTP này
$mail -> SMTPSecure = 'ssl'; // sử dụng giao thức SSL vì gmail bắt buộc dùng cái này
$mail -> Host = 'smtp.gmail.com';
$mail -> Port = 465;
$mail -> Username = 'vananhkm11@gmail.com';
$mail -> Password = 'anh12211221';
$mail -> AddAddress('coelsman@gmail.com');
$mail -> SetFrom($mail->Username, 'No Reply');
$mail -> Subject = 'Demo send mail';
$mail -> Body = 'Heo ???';
//$mailsis ="daihongphatco@gmail.com";
// $mail -> AddCC( $mailsis );
//$mailsis2 ="webtriviet@gmail.com";
//$mail -> AddCC( $mailsis2 );
// $mail -> AddAddress( $to );
if( ! $mail -> Send() ) {
$error = ' error: '.$mail -> ErrorInfo;
echo $error; die;
return false;
} else {
$error = ' ';
return true;
}
}
}