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
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><?php require_once("config.inc.php"); //--------------------------------------------------------------------------------------------------------------------------------------------------- $link = mysql_connect($cfgServers['host'],$cfgServers['stduser'],$cfgServers['stdpass'])or die("Can't connect Server"); mysql_select_db($cfgServers['selectdb']) or die("Can't connect databases"); $query="SELECT * FROM consult WHERE cons_id ='".$_GET['currID']."' "; mysql_query("SET NAMES UTF8"); mysql_query("SET character_set_results=utf8"); mysql_query("SET character_set_client='utf8'"); mysql_query("SET character_set_connection='utf8'"); mysql_query("collation_connection = utf8_unicode_ci"); mysql_query("collation_database = utf8_unicode_ci"); mysql_query("collation_server = utf8_unicode_ci"); $result=mysql_query($query); $data=mysql_fetch_assoc($result); echo $data['cons_topic']; require("class.phpmailer.php"); $mail = new PHPMailer(); $mail->IsSMTP(); // set mailer to use SMTP $mail->Host = "mail.anutra.co.th"; // specify main and backup server $mail->SMTPAuth = true; // turn on SMTP authentication $mail->Username = "mailsender@anutra.co.th"; // SMTP username $mail->Password = "12345678"; // SMTP password $mail->From = "mailsender@anutra.co.th"; $mail->FromName = "anutra Information"; $mail->AddAddress($data['cons_email'], $data['cons_name']); $mail->AddReplyTo("info@anutra.co.th", "anutra Information"); $mail->WordWrap = 200; // set word wrap to 50 characters $mail->IsHTML(true); // set email format to HTML $mail->Subject = "www.anutra.co.th ";
$mail->Body="สวัสดีค่ะ คุณ ลภัสรดา จันทร์คง <br>" ." สำหรับข้อมูลที่สอบถามผ่านทางหน้าเว็บไซต์ www.anutra.co.th <br>" /*." หัวข้อคำถาม: ".$data['cons_topic']."<br> " ." คำถาม: ".$data['cons_topic']."<br> "*/
." คุณสามารถคลิกไปดูคำตอบจากแพทย์ผู้เชี่ยวชาญของอนุตราคลินิก ได้ที่นี่ <br> " ." <a href='http://www.anutra.co.th/QA.php?QA=".$_GET['currID']."'>http://www.anutra.co.th/QA.php?QA=".$_GET['currID']."</a> <br><br><br> "
." ทีมงานบริหารเว็บไซต์ <br>" ."<a href='http://www.anutra.co.th'>www.anutra.co.th</a>";
if(!$mail->Send()) { print("".$mail->ErorInfo); } else { ?> <script language="javascript"> alert('ส่งเมล์ถึงผุู้รับแล้วครับ'); window.location.href='main.php?work=Consult'; </script> <!-- print("ส่งเมล์ถึงผุู้รับแล้วครับ"); --> <!--print $textMessage; --> <?php } ?>
|