| Server IP : 210.245.233.93 / Your IP : 216.73.216.226 Web Server : Apache/2.2.15 (CentOS) System : Linux webserver2.onesolution.com.hk 2.6.32-754.35.1.el6.x86_64 #1 SMP Sat Nov 7 12:42:14 UTC 2020 x86_64 User : apache ( 48) PHP Version : 5.3.3 Disable Function : exec, shell_exec, system, passthru, popen, proc_open, pcntl_exec MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/hkosl.com/securexpert/ |
Upload File : |
<?php
error_reporting(0);
ini_set('display_errors', 0);
require_once __DIR__ . '/vendor/dapphp/securimage/securimage.php';
require_once __DIR__ . '/vendor/phpmailer/phpmailer/PHPMailerAutoload.php';
$image = new Securimage();
if ($image->check($_POST['captcha_code']) == true) {
// echo "Correct!";
$mail = new PHPMailer(true); // Passing `true` enables exceptions
try {
$x_mail = new PHPMailer();
//Server settings
// $mail->SMTPDebug = 2; // Enable verbose debug output
// $mail->isSMTP(); // Set mailer to use SMTP
$mail->Host = 'localhost'; // Specify main and backup SMTP servers
// $mail->SMTPAuth = true; // Enable SMTP authentication
// $mail->Username = '5dad06ab71a26f'; // SMTP username
// $mail->Password = '9c7615563f25fe'; // SMTP password
// $mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted
// $mail->Port = 465; // TCP port to connect to
$mail->CharSet = 'UTF-8';
//Recipients
$mail->setFrom('sales@securexpert.com.hk', '');
$mail->addAddress('sales@securexpert.com.hk', ''); // Add a recipient
// $mail->addAddress('recipient@example.com'); // Name is optional
// $mail->addReplyTo('replyto@example.com', 'Information');
// $mail->addCC('cc@example.com');
// $mail->addBCC('bcc@example.com');
//Attachments
// $mail->addAttachment('/var/tmp/file.tar.gz'); // Add attachments
// $mail->addAttachment('/tmp/image.jpg', 'new.jpg'); // Optional name
//Content
$mail->isHTML(true); // Set email format to HTML
$mail->Subject = '剛剛接收到一個來自網站上的查詢';
$mail->Body = "<p>姓名: ".htmlspecialchars($_POST['name'])."</p>
<p>電話: ".htmlspecialchars($_POST['tel'])."</p>
<p>電子郵件: ".htmlspecialchars($_POST['email'])."</p>
<p>留言: ".nl2br(htmlspecialchars($_POST['content']))."</p>";
// $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
if (!$mail->send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
//echo "Message sent!";
header('Location: index.php');
}
} catch (Exception $e) {
echo 'Message could not be sent. Mailer Error: ', $mail->ErrorInfo;
}
} else {
echo "Sorry, wrong code.";
}
?>