สอบถามเรื่อง send email php ครับ

ถาม-ตอบ แนะนำไอเดียว โค้ดตัวอย่าง แนวทาง วิธีแก้ปัญหา สอบถามเรื่อง send email php ครับ

สอบถามเรื่อง send email php ครับ
นี่คือ code ครับ ไมมันส่งไม่ได้อ่ะ มี code ผิดตรงไหนหรือเปล่าครับ ถ้าไม่ผิดต้องไปแก้ตรงไหนของ host หรือ เปล่า?

<?php

 if($_GET[page] == "contact_sent"){

    $strTo = "win.cosmetics.it@gmail.com";
    $strSubject = "Wincosmetics.co.th";
    $strHeader = "Content-type: text/html; charset=utf-8
";
    $strMessage =  "
    <table width='100%' border='1' bordercolor='#000000'>
  <tr>
    <td colspan='2' bgcolor='#CCCCCC'><center>ข้อมูลติดต่อ จากเว็บไซต์</center></td>
  </tr>
  <tr>
    <td width='6%' bgcolor='#CCCCCC'><center>ชื่อ - นามสกุล</center></td>
    <td>".$_POST[contact_name]."</td>
  </tr>
  <tr>
    <td bgcolor='#CCCCCC'><center>อีเมล์</center></td>
    <td>".$_POST[contact_email]."</td>
  </tr>
  <tr>
    <td bgcolor='#CCCCCC'><center>เบอร์โทร</center></td>
    <td>".$_POST[contact_phone]."</td>
  </tr>
  <tr>
    <td bgcolor='#CCCCCC'><center>หัวข้อ</center></td>
    <td>".$_POST[contact_supject]."</td>
  </tr>
    <tr>
    <td bgcolor='#CCCCCC'><center>ข้อความ</center></td>
    <td>".$_POST[contact_message]."</td>
  </tr>
</table>
 ";
$flgSend = @mail($strTo,$strSubject,$strMessage,$strHeader);  // @ = No Show Error //
    if($flgSend){
        echo'<section class="slice bg-base" style="padding:90px 0;">
        <div class="wp-section">
            <div class="container">
                <div class="row">
                    <div class="col-md-12">
                        <div class="text-center">
                            <h2>ส่งข้อความสำเร็จ</h2>
                           
                            <p>
                                ทางเราจะติดต่อหาท่านโดยเร็วที่สุด
                                <br>
                                หากเกิดข้อผิดพลาดประการใด ขออภัย ณ ที่นี้ด้วยค่ะ ขอบคุณค่ะ
                            </p>
                            <span class="clearfix"></span>
    
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>';
    }else{
        echo'<section class="slice bg-base" style="padding:90px 0;">
        <div class="wp-section">
            <div class="container">
                <div class="row">
                    <div class="col-md-12">
                        <div class="text-center">
                            <h2>ส่งข้อความไม่สำเร็จ</h2>
                           
                            <p>
                                ผิดพลาด กรุณาส่งข้อความใหม่ !!...
                                <br>
                               หากส่งข้อความไม่ได้ กรุณาติด่ต win.cosmetics.it@gmail.com หรือ win.cosmetics.shop@gmail.com
                            </p>
                            <span class="clearfix"></span>
    
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>';
    }

}

echo"<META HTTP-EQUIV="REFRESH"CONTENT="2; URL=index.php">";
?>


ิbondsanti 103.10.231.xxx 05-01-2015 14:44:39

คำแนะนำ และการใช้งาน

สมาชิก กรุณา ล็อกอินเข้าระบบ เพื่อตั้งคำถามใหม่ หรือ ตอบคำถาม สมาชิกใหม่ สมัครสมาชิกได้ที่ สมัครสมาชิก


  • ถาม-ตอบ กรุณา ล็อกอินเข้าระบบ
  • เปลี่ยน


    ( หรือ เข้าใช้งานผ่าน Social Login )

 ความคิดเห็นที่ 1
ทดสอบผ่าน server จริงหรือว่างลองที่เครื่อง localhost 
ถ้าลองที่เครื่อง ใช้แบบธรรมดาคงส่งไม่ได้ แต่ถ้าทำที่ฝั่ง server แล้ว ลองเอาตัวแต้ง error ออกดูว่า
สาเหตุที่สงไม่ได้เพราะอะไร จะมีแจ้ง


ninenik 1.46.208.xxx 05-01-2015
 ความคิดเห็นที่ 2
รันใน server ครับ



ิbondsanti 103.10.231.xxx 11-01-2015 10:52
 ความคิดเห็นที่ 3
ลองใช้ตัวนี้ดูครับ ผมใช้อยู่
	$strTo = "ekiidmoinsz@gmail.com";
        	$strSubject = "ติดต่อ-สอบถาม";
	$strname = $_POST["name"];
	$stremail = $_POST["email"];
	$strtel = $_POST["tel"];
	$strdetail = $_POST["detail"];
	$strHeader = "Content-type: text/html; charset=windows-utf-8rn"; // or UTF-8 //
	$strHeader .= "From: $strname<khanthaketmsi@hotmail.com>rnReply-To: ekiidmoinsz@gmail.com";
	$strMessage = "<h1>ข้อความจากลูกค้า</h1>
	<strong>ชื่อ - นามสกุล : $strname</strong><br>
	<strong>เบอร์โทรศัพท์ : $strtel</strong><br>
	<strong>อีเมล์ : $stremail</strong><br>
	<strong>ข้อความ : $strdetail</strong>";
	$flgSend = @mail($strTo,$strSubject,$strMessage,$strHeader);  
 


khanthaket 124.122.66.xxx 16-01-2015 16:50
1






เว็บไซต์ของเราให้บริการเนื้อหาบทความสำหรับนักพัฒนา โดยพึ่งพารายได้เล็กน้อยจากการแสดงโฆษณา โปรดสนับสนุนเว็บไซต์ของเราด้วยการปิดการใช้งานตัวปิดกั้นโฆษณา (Disable Ads Blocker) ขอบคุณครับ