| 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/gba-owea/en/ |
Upload File : |
<?php
//error_reporting(E_ALL);
//ini_set('display_errors', 0);
require_once dirname(__DIR__). '/vendor/dapphp/securimage/securimage.php';
require_once dirname(__DIR__). '/vendor/phpmailer/phpmailer/PHPMailerAutoload.php';
$image = new Securimage();
if ($image->check($_POST['captcha_code']) == true) {
//echo "Correct!";
//exit;
$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 = ''; // SMTP username
// $mail->Password = ''; // 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('info@gba-owea.com', '大灣區傑出女企業家獎');
$mail->addAddress('info@gba-owea.com', ''); // 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 = '剛剛接收到一個來自 '.htmlspecialchars($_POST['contactform-name']).' 大灣區傑出女企業家獎網站上的查詢';
$mail->Body = "<p>姓名: ".htmlspecialchars($_POST['contactform-name'])."</p>
<p>電郵: ".htmlspecialchars($_POST['contactform-email'])."</p>
<p>電話: ".htmlspecialchars($_POST['contactform-phone'])."</p>
<p>主題: ".htmlspecialchars($_POST['contactform-subject'])."</p>
<p>内容: ".nl2br(htmlspecialchars($_POST['contactform-message']))."</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: contactus.php');
}
} catch (Exception $e) {
echo 'Message could not be sent. Mailer Error: ', $mail->ErrorInfo;
}
} else {
echo "Sorry, wrong code.";
}
?>