 |
ส่งอีเมล์ตอบกลับให้ลูกค้าไม่ได้ค่ะ รบกวนดูให้ที่ค่ะ สำคัญมากๆๆ |
|
 |
|
|
 |
 |
|
Code (PHP)
<?
$user_forget=$_POST[user_forget];
?>
<!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; charecset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?
if ($user_forget==""){
echo "<h3>ERROR ::Plese enter your Username ::</h3>";
exit();
}
include "config.php";
$sql="select * from tb_member where username='$user_forget'";
$result=mysql_db_query($dbname,$sql);
$num=mysql_num_rows($result);
$record=mysql_fetch_array($result);
$to=$record[email];
$password=$record[password];
if($num<=0) {
echo "<h3>ERROR : Username นี้ไม่มีอยู่ในระบบสมาชิกค่ะ</h3>";
} else {
$subject= "แจ้งรหัสผ่านแก่สมาชิกร้าน Oilshop ";
$message="รหัสผ่านของ Username :$user_forget คือ $password";
$headers="From : Member Oilshop ";
if (mail($to,$subject,$message,$headers)) {
echo "<h3>send password to your email</h3>";
} else {
echo "<h3>sorry can't send password to your email</h3>";
}
}
mysql_close();
?>
</body>
</html>
|
 |
 |
 |
 |
Date :
2012-02-22 17:01:36 |
By :
katay |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ช่วยหน่อยนะค่ะ แก้ไม่ได้จริงๆ
|
 |
 |
 |
 |
Date :
2012-02-22 20:40:06 |
By :
koi |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
รันบนโฮสจริง ๆ ครับ ไม่น่ามีปัญหา 
|
 |
 |
 |
 |
Date :
2012-02-22 20:45:08 |
By :
webmaster |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เป็นเพราะ
$headers="From : Member Oilshop ";
ต้องใช้เป็น
$headers="From : [email protected] ";
รึเปล่าครับ ไม่ใช่ เป็นชื่อเฉยๆ
ไม่งั้นลองเข้าไปดูใน php.ini แล้ว set email address ที่ ;sendmail_from
อย่าลืมเอา ; ออกด้วย
แล้ว save php.ini
จากนั้น restart apache 1 ที แล้วลองใหม่ครับ
แต่คิดว่าไม่จำเป็นต้องไป set ที่ php.ini แค่ เปลี่ยน $headers ที่ว่า ให้เป็น email address ที่ถูกต้อง
|
 |
 |
 |
 |
Date :
2012-02-22 20:50:01 |
By :
Likito |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
กรณีที่ต้องการส่งเป็นชื่อครับ
Code (PHP)
$strHeader = "From: Mr.Weerachai Nukitram<[email protected]>";
Code (PHP)
<html>
<head>
<title>ThaiCreate.Com PHP Sending Email</title>
</head>
<body>
<?
$strTo = "[email protected]";
$strSubject = "Test Send Email";
$strHeader = "From: Mr.Weerachai Nukitram<[email protected]>";
$strMessage = "My Body & My Description";
$flgSend = @mail($strTo,$strSubject,$strMessage,$strHeader); // @ = No Show Error //
if($flgSend)
{
echo "Email Sending.";
}
else
{
echo "Email Can Not Send.";
}
?>
</body>
</html>
|
 |
 |
 |
 |
Date :
2012-02-22 20:59:50 |
By :
webmaster |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณมากจริงๆๆนะค่ะ เดี๋ยวลองไปทำดูนะค่ะ แล้วจะมารายงานผลนะค่ะ
|
 |
 |
 |
 |
Date :
2012-02-24 09:08:31 |
By :
katay |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
<?
$user_forget=$_POST[user_forget];
?>
<!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; charecset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?
if ($user_forget==""){
echo "<h3>ERROR ::Plese enter your Username ::</h3>";
exit();
}
include "config.php";
$sql="select * from tb_member where username='$user_forget'";
$result=mysql_db_query($dbname,$sql);
$num=mysql_num_rows($result);
$record=mysql_fetch_array($result);
$to=$record[email];
$password=$record[password];
if($num<=0) {
echo "<h3>ERROR : Username นี้ไม่มีอยู่ในระบบสมาชิกค่ะ</h3>";
} else {
$strSubject = "แจ้งรหัสผ่านแก่สามชิกร้าน Oilshop";
$strHeader = "From: MissBussabong<[email protected]>";
$strMessage = "รหัสผ่านของ Username :$user_forget คือ $password";;
$flgSend = @mail($to,$strSubject,$strMessage,$strHeader); // @ = No Show Error //
if($flgSend)
{
echo "Email Sending.";
}
else
{
echo "Email Can Not Send.";
}
?>
</body>
</html>
ช่วยตรวจสอบให้หน่อยค่ะ เขียนแล้วมันเกิด Error ::Parse error: syntax error, unexpected $end in C:\AppServ\www\Oilshop\forgetpassword3.php on line 53 นี้อ่ะค่ะพี่
|
 |
 |
 |
 |
Date :
2012-02-24 10:44:28 |
By :
katay |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณนะค่ะ
|
 |
 |
 |
 |
Date :
2012-02-29 08:34:35 |
By :
katay |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|