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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
|
<?php //======================================================= if($_POST['action']=='Send'){ $_image=explode("_",$_POST['selectPromotion']); $Images =$_image[1]; $urls=$_image[0]; //--------------------------------------------------------------------------------- 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 = "info@anutra.co.th"; $mail->FromName = " Promotion from anutra.co.th "; $mail->AddReplyTo("info@anutra.co.th"); $query="SELECT email FROM tbl_member "; $resultmail=mysql_query($query); while($data=mysql_fetch_assoc($resultmail)){ $xMail=$data['email']; $mail->AddAddress( $xMail ,""); //echo $xMail."<br>"; } $mail->AddReplyTo("info@anutra.co.th"); $mail->WordWrap = 50; // set word wrap to 50 characters //$mail->AddAttachment("/var/tmp/file.tar.gz"); // add attachments //$mail->AddAttachment("/tmp/image.jpg", "new.jpg"); // optional name $mail->IsHTML(true); // set email format to HTML $mail->Subject = "Promotion from anutra.co.th "; $textMessage="<table id='Table_01' width='800' border='0' cellpadding='0' cellspacing='0'> <tr> <td> <img src='http://www.anutra.co.th/images/e-news/e-news_01.gif' width='800' height='108' alt=''></td> </tr> <tr> <td background='http://www.anutra.co.th/images/e-news/e-news_02.gif'> <img src='http://www.anutra.co.th/images/e-news/e-news_02.gif' width='800' height='9' alt=''></td> </tr> <tr> <td width='800' align='center' background='http://www.anutra.co.th/images/e-news/e-news_03.gif'><img src='http://www.anutra.co.th/content/images/".$Images."'></td> </tr> <tr> <td width='800' height='71' align='center' background='http://www.anutra.co.th/images/e-news/e-news_04.gif'><a href='http://www.anutra.co.th/anutra_clinic/promotion_detail.php?ID=$urls' target='_blank'><img src='http://www.anutra.co.th/images/e-news/more-e-news.png' width='196' height='27' border='0'></a></td> </tr> <tr> <td><table width='100%' border='0' cellspacing='0' cellpadding='15'> <tr> <td style='font-family:Arial, Helvetica, sans-serif; font-size:9pt; color:#999'>If you cannot see this email, please <a href='http://www.anutra.co.th/anutra_clinic/promotion_detail.php?ID=$urls' target='_blank'>click here</a><br> ËÒ¡¤Ø³äÁèÊÒÁÒöÍèÒ¹ÍÕàÁÅ쩺Ѻ¹Õéä´é¡ÃØ³Ò <a href='http://www.anutra.co.th/anutra_clinic/promotion_detail.php?ID=$urls' target='_blank'>¤ÅÔ¡·Õè¹Õè</a></td> <td align='right' style='font-family:Arial, Helvetica, sans-serif; font-size:9pt; color:#999'>@ 2011 ANUTRA CLINIC. All rights reserved.</td> </tr> </table></td> </tr> </table>"; $mail->Body = $textMessage; if(!$mail->Send()) { echo "Message could not be sent. <p>"; echo "Mailer Error: " . $mail->ErrorInfo; exit; } $redirect=1; echo "Message has been sent";
//--------------------------------------------------------------------------------- } //------------------------------------------------- $sql="SELECT * FROM content WHERE contenttype_id='2' ORDER BY content_id DESC "; $result=mysql_query($sql);
?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-874" /> <title>Untitled Document</title> <link href="style.css" rel="stylesheet" type="text/css" /> <script language="javascript"> function deleteThis(ids){ if(confirm('µéͧ¡ÒÃźÃÒ¡ÒùÕé ?')){ document.form1.currID.value=ids; document.form1.action.value='Delete'; document.form1.submit(); }else{ return false; } } //---------------------------------- function checkForm(){ if(document.form1.selectPromotion.value=='x'){ alert('¡ÃسÒàÅ×Í¡â»ÃâÁªÑè¹'); return false; }else{ document.form1.action.value='Send'; } } //---------------------------------- function showPic(values){ var mySplitResult = values.split("_"); //alert(mySplitResult[1]); document.getElementById("showPic").innerHTML="<img src='../content/images/"+mySplitResult[1]+"'>"; } </script> </head>
<body><form action="<?php $_SERVER['PHP_SELF']?>" method="post" name="form1" enctype="multipart/form-data" onsubmit="checkForm()"> <table width="100%" border="0" cellspacing="3" cellpadding="3"> <tr> <td class="txt10-black"><table width="100%" border="0"> <tr> <td width="15%" align="right">ËÑÇ¢éÍâ»ÃâÁªÑè¹</td> <td width="85%"> <select name="selectPromotion" id="selectPromotion" onchange="showPic(this.value)"> <option value="x">----------------</option> <?php while($data=mysql_fetch_assoc($result)){?> <option value="<?php echo $data['content_id']?>_<?php echo $data['content_image']?>"><?php echo $data['content_topic']?></option> <?php }?> </select> </td> </tr> <tr> <td align="right">ÃÙ»â»ÃâÁªÑè¹</td> <td><div id="showPic"></div></td> </tr> <tr> <td align="right"> </td> <td><input type="submit" name="button" id="button" value="Submit" /></td> </tr> </table></td> </tr> <tr> <td class="kbank"> </td> </tr> <tr> <td class="kbank"><span class="txt10-black"> <input type="hidden" name="action" id="action" /> <input name="currID" type="hidden"/> </span></td> </tr> </table> </form> </body> </html>
|