|
|
|
ช่วยทีครับ แนะนำรูปแบบการส่งรายการสั่งซื้อ ไปให้ทางอีเมลทีครับ |
|
|
|
|
|
|
|
เคยเขียนไว้ครับ
Code (PHP)
<?
$strTo = "[email protected]";
$strSubject = "Test Send Email";
$strHeader = "Content-type: text/html; charset=windows-874\n"; // or UTF-8 //
$strHeader .= "From: Mr.Weerachai Nukitram<[email protected]>\nReply-To: [email protected]";
$strVar = "My Message";
$strMessage = "
<h1>My Message</h1><br>
<table width='285' border='1'>
<tr>
<td><div align='center'><strong>My Message </strong></div></td>
<td><div align='center'><font color='red'>My Message</font></div></td>
<td><div align='center'><font size='2'>My Message</font></div></td>
</tr>
";
$strSQL = "SELECT * FROM table-name";
$objQuery = mysql_query($strSQL);
while($objResult = mysql_fetch_array($objQuery))
{
$strMessage .= "<tr>
<td><div align='center'>".$objResult["item1"]."</div></td>
<td><div align='center'>".$objResult["item2"]."</div></td>
<td><div align='center'>".$objResult["item3"]."</div></td>
</tr>";
}
$strMessage .= "</table>";
$flgSend = @mail($strTo,$strSubject,$strMessage,$strHeader); // @ = No Show Error //
if($flgSend)
{
echo "Email Sending.";
}
else
{
echo "Email Can Not Send.";
}
?>
|
|
|
|
|
Date :
2012-12-07 15:58:27 |
By :
mr.win |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 03
|