<form action="sendmail.php" method="post" name="frmMain"> <div class="contact"> <!--<div class="contact_left BodyStyle"><strong>ถึง</strong></div> <div class="contact_right BodyStyle"><input name="txtTo" type="text" id="txtTo"></div>--> <div class="contact_left BodyStyle"><strong>หัวข้อ</strong></div> <div class="contact_right BodyStyle"><input name="txtSubject" type="text" id="txtSubject"></div> <div class="contact_left BodyStyle" style="height:320px;"><strong>รายละเอียด</strong></div> <div class="contact_right BodyStyle" style="height:320px;"><textarea name="txtDescription" cols="30" rows="4" id="txtDescription" style="width:300px; height:300px;"></textarea></div> <div class="contact_left BodyStyle"><strong>ชื่อผู้ส่ง</strong></div> <div class="contact_right BodyStyle"><input name="txtFormName" type="text"></div> <div class="contact_left BodyStyle"><strong>Email</strong></div> <div class="contact_right BodyStyle"><input name="txtFormEmail" type="text"></div> <div class="clear contact_button"><input type="image" name="Submit" value="Send" src="images/button_submit.png"/></div> </div> </form>
<?php require_once('class.phpmailer.php'); $mail = new PHPMailer(); $mail->IsHTML(true); $mail->IsSMTP(); $mail->SMTPAuth = true; // enable SMTP authentication $mail->SMTPSecure = "ssl"; // sets the prefix to the servier $mail->Host = "smtp.gmail.com"; // sets GMAIL as the SMTP server $mail->Port = 465; // set the SMTP port for the GMAIL server $mail->Username = "[email protected]"; // GMAIL username $mail->Password = "xxxxxxx"; // GMAIL password $mail->From = $_POST["txtFormEmail"]; // "[email protected]"; //$mail->AddReplyTo = "[email protected]"; // Reply $mail->FromName = $_POST["txtFormName"]; // set from Name $mail->Subject = $_POST["txtSubject"]; $mail->Body = nl2br($_POST["txtDescription"]); $mail->AddAddress("[email protected]", "Webmaster thungluang-rb.go.th"); // to Address //$mail->AddCC("[email protected]", "Mr.Member ShotDev"); //CC //$mail->AddBCC("[email protected]", "Mr.Member ShotDev"); //CC $mail->set('X-Priority', '1'); //Priority 1 = High, 3 = Normal, 5 = low $mail->Send(); ?>
$mail->AddAddress("[email protected]", "Webmaster thungluang-rb.go.th"); // to
$mail->AddAddress($_POST["txtFormEmail"], "Webmaster thungluang-rb.go.th"); // to
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง