ÿØÿà 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/phpmailer/ |
Upload File : |
<?php
require_once('class.phpmailer.php');
function smtpmailer($to, $from, $from_name, $subject, $body) {
global $error;
$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 = 0; // 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 = 'thainv12@gmail.com';
$mail -> Password = 'thainv12@1';
$mail -> SetFrom($from, $from_name);
$mail -> Subject = $subject;
$mail -> Body = $body;
$mail -> AddAddress( $to );
if( ! $mail -> Send() ) {
$error = ' error: '.$mail -> ErrorInfo;
return false;
} else {
$error = ' thư của bạn đã được gởi đi ';
return true;
}
}
if($_POST){
smtpmailer('nguyenthai@trivietit.net', 'thainv12@gmail.com', 'yourName', 'test mail message', 'Hello World!' );
// gởi xong rồi thông báo gì đó cho ngươi dùng :D viết ở đây
//if (!empty( $error )) echo $error;else echo 'success';
}
?>
<form name="" action="" method="post">
<input type="submit" name="submit">
</form>