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
|
<?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=utf-8" /> <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; } } </script> </head>
<body><form action="mailto_membert.php" 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="20%" align="right">หัวข้อเมล์</td> <td width="80%"><input name="topic" type="text" id="topic" size="50" maxlength="100" /></td> </tr> <tr> <td align="right">รายละเอียด</td> <td><textarea name="detail" cols="45" rows="7" id="detail"></textarea><script language="javascript1.2"> generate_wysiwyg('detail'); </script></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>
|