/var/www/onesolution.com.hk/support/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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<?php
ini_set
('display_errors'1);
ini_set('log_errors'1);
ini_set('error_log'dirname(__FILE__) . '/error_log.txt');
error_reporting(E_ALL);
$name        "Name";
$email        $email;
$subject    "One Solution Limited - Support";
//$message    = $_POST["message"];

$INCLUDE_DIR "";
$to "";

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

$body '<HTML>';
$body .= '<HEAD>';
$body .= '<TITLE></TITLE>';
$body .= '<META http-equiv=Content-Type content=text/html; charset=big5>';
$body .= '<link href="style.css" rel="stylesheet" type="text/css" />';
$body .= '</HEAD>';
$body .= '<body LINK=#0000ff VLINK=#800080 bgcolor=#FFFFFF leftMargin=10 topMargin=20 marginheight=0 marginwidth=0>';
$body .= '<p style="font-family:Arial;font-size=10">';
$body .= 'Thank you for using One Solution Limited service.';
$body .= 'Please use the following URL to accept the job.';
$body .= "<br>Job no:"$jobid;
$body .= "<br><a href='http://www.onesolution.com.hk/support/jobdetail.php?id=".md5($jobid)."'>http://www.onesolution.com.hk/support/jobdetail.php?jobid="md5($jobid) ."</a>";
//$body .= "<br><a href='http://www.onesolution.com.hk/support/jobdetail.php?jobid=".($jobid)."'>http://www.onesolution.com.hk/support/jobdetail.php?jobid=". md5($jobid) ."</a>";
$body .= '<br>by '.$_SESSION['userid'];
$body .= '</p>';
$body .= '</BODY>';
$body .= '</HTML>';

$FromEmail "support@onesolution.com.hk";
$to=$email;

$FromName "One Solution Limited - Support";

$x_mail = new PHPMailer();
$x_mail->IsSMTP();
//$x_mail->Host = "smtp.pacific.net.hk";
//$x_mail->Host = "smtp.onesolution.com.hk";
//$x_mail->Host = "192.168.11.99";
$x_mail->Host "localhost";
//$x_mail->SMTPAuth = true;
//$x_mail->Username = "onesolution";
//$x_mail->Password = "3d4r5g6y";
$x_mail->charSet "utf-8";
$x_mail->From $FromEmail;
$x_mail->FromName $FromName;

/*
$to = str_replace(",",";",$to);
$l = strlen($to);
while ($l>0)
{
    $x_mail->AddAddress(substr($to,0,strpos($to,";")),substr($to,0,strpos($to,";")));
    $to = substr($to,strpos($to,";")+1);
    if (strpos($email,";") == 0)
    {
        $l = 0;
    }
}
*/

$x_mail->AddAddress($to,$to);

//$x_mail->AddAddress("support@onesolution.com.hk");
//$x_mail->AddAddress("jonathantsang@onesolution.com.hk");
//$x_mail->AddAddress("samliu@onesolution.com.hk");
//$x_mail->AddAddress("sliaoysh@gmail.com");

$sql99 "select content from sys_other where id = 1";
$result99 mysql_query($sql99);
$row99 mysql_fetch_assoc($result99);

$x_mail->AddBCC($row99['content']);

$x_mail->WordWrap 50;
$x_mail->IsHTML(true);
$x_mail->Subject $subject;
$x_mail->Body    $body;
$x_mail->Send();




//$headers = 'From: '.$FromEmail."\r\n";
//$headers .= 'Bcc: '.$row99['content']."\r\n";

//$msg = "Surname: $sname\nFirst name: $fname\nPhone: $phone\nAddress:\n$address
//Remarks:\n$remark";

//mail($email, '=?UTF-8?B?'.base64_encode("One Solution Limited - Support").'?=', $body, $headers);

/*
$handle = fopen("http://www.google.com/", "r");
$buffer = fgets($handle);
echo "<br />";
echo $buffer."<br />";
*/
/*
echo "<br />";
echo $to."<br />";
echo $row99['content']."<br />";
exit();
*/
?>