<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Untitled Document</title> <script type="text/javascript" language="javascript"> function IsCheck(txtSubject, txtFormEmail, txtDescription) { if(document.getElementById(txtSubject).value == '' && document.getElementById(txtFormEmail).value == '' && document.getElementById(txtDescription).value == '' ) { alert('Please enter information.'); return false; } else if(document.getElementById(txtSubject).value == '' || document.getElementById(txtFormEmail).value == '' || document.getElementById(txtDescription ).value == '' ) { alert('Please enter information.'); return false; } else return true; }; </script> <style type="text/css"> <!-- .style1 {font-size: small} --> </style> </head> <body> <form action="phpSendMailUploadAttach.php" method="post" enctype="multipart/form-data" name="frmMain"> <table width="343" border="0"> <tr> <td> <input name="txtTo" id="txtTo" type="text" style="visibility: hidden; value=" value="[email protected]" size="2"" ></td> </tr> <tr> <td><span class="style1"><strong>Name</strong></span></td> <td><input name="txtSubject" id="txtSubject" type="text"></td> </tr> <tr> <td><span class="style1"><strong>E-MAIL</strong></span></td> <td><input name="txtFormEmail" id="txtFormEmail" type="text"></td></tr> <tr> <td><span class="style1"><strong>Massage</strong></span></td> <td><textarea name="txtDescription" id="txtDescription" cols="30" rows="4"></textarea></td></tr> <tr> <td> </td> <td><input type="image" name="btnSubmit" onclick= "return IsCheck('txtSubject','txtFormEmail','txtDescription');" value="" img src="img/16.png"></td> </tr> </table> </form> </body> </html>
<html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> </head> <body> <? $strTo = $_POST["txtTo"]; $strSubject = $_POST["txtSubject"]; $strMessage = nl2br($_POST["txtDescription"]); //*** Uniqid Session ***// $strSid = md5(uniqid(time())); $strHeader = ""; $strHeader .= "From: ".$_POST["txtSubject"]."<".$_POST["txtFormEmail"].">\nReply-To: ".$_POST["txtFormEmail"].""; $strHeader .= "MIME-Version: 1.0\n"; $strHeader .= "Content-Type: multipart/mixed; boundary=\"".$strSid."\"\n\n"; $strHeader .= "This is a multi-part message in MIME format.\n"; $strHeader .= "--".$strSid."\n"; $strHeader .= "Content-type: text/html; charset=utf-8\r\n"; // or UTF-8 // $strHeader .= "Content-Transfer-Encoding: 7bit\n\n"; $strHeader .= "<img src='http://icons.iconarchive.com/icons/ahmadhania/spherical/24/email-icon.png'><b><font color=\"gray\" font size=2> อีเมล์ฉบับนี้ ถูกจัดส่งมาจากเว็บไซต์ caran d'ache</font></b><hr><br>"; $strHeader .= $strMessage."\n\n"; //*** Attachment ***// $flgSend = @mail($strTo,$strSubject,null,$strHeader); // @ = No Show Error // if($flgSend) { echo "<img src='http://icons.iconarchive.com/icons/gakuseisean/ivista-2/24/Alarm-Tick-icon.png'><b><font color=\"green\" font size=2> Message has been sent. The team will get back to you as soon as possible thanks.</font></b>"; } else { echo "กรุณากรอกข้อความให้คบทุกช่องค่ะ."; } ?> </body> </html>
<?php ini_set('smtp','your_smtp_host'); ini_set('port','25'); // 25 smtp default port ?>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง