/var/www/awintours.com/sendEmail.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
$name        
$_POST["name"];
$phone        $_POST["phone"];
$email        $_POST["email"];
$message    $_POST["message"];

if (
$name == '') {
    
header("Location: contactus.php"); 
    exit;
} else if  (
$email == '') {
    
header("Location: contactus.php");
    exit;
}

$INCLUDE_DIR "";
$to "";

//require("phpunit.php");
require($INCLUDE_DIR "class.phpmailer.php");
error_reporting(E_ALL);


$body '<HTML>';
$body .= '<HEAD>';
$body .= '<TITLE>Avonwin Holdings Tours Limited</TITLE>';
$body .= '<META http-equiv=Content-Type content=text/html; charset=UTF-8>';
$body .= '</HEAD>';
$body .= '<BODY>';
$body .= '<table width="600" border="0" cellpadding="0" cellspacing="0" style="font-family:Arial;font-size:12px;">';
$body .= '<tr>';
$body .= '  <td height="35" colspan="2" align="center"><strong>&nbsp;&nbsp;網上意見/查詢</strong></td>';
$body .= '</tr>';
$body .= '<tr><td width="132" height="25" align="left" valign="top">聯絡人姓名:&nbsp;&nbsp;</td>';
$body .= '<td width="468" align="left" valign="top">'.$name.'</td></tr>';
$body .= '<tr><td width="132" height="25" align="left" valign="top">聯絡人電話:&nbsp;&nbsp;</td>';
$body .= '<td width="468" align="left" valign="top">'.$phone.'</td></tr>';
$body .= '<tr><td width="132" height="25" align="left" valign="top">聯絡人電郵:&nbsp;&nbsp;</td>';
$body .= '<td width="468" align="left" valign="top">'.$email.'</td></tr>';
$body .= '<tr><td width="132" height="25" align="left" valign="top">內容:&nbsp;&nbsp;</td>';
$body .= '<td width="468" align="left" valign="top">'.$message.'</td></tr>';
$body .= '</table>';
$body .= '</BODY>';
$body .= '</HTML>';

$subject="收到一個客人網上查詢的電郵";
$FromEmail=$email;
$to="sales@awintours.com";
$FromName=$name;
$x_mail = new PHPMailer();
$x_mail->IsSMTP();
//$x_mail->Host = "smtp.pacific.net.hk";
$x_mail->Host "localhost";
$x_mail->SMTPAuth true;
$x_mail->charSet "UTF-8";
$x_mail->From $email;
$x_mail->FromName $FromName;
$x_mail->AddAddress($to,$to);
$x_mail->WordWrap 50;
$x_mail->IsHTML(true);
$x_mail->Subject $subject;
$x_mail->Body    $body;
$x_mail->Send();
header("Location: contactus_reply.php");
?>