我已經運行到有點用PHP MAIL命令 的問題。當我去處理它,它只是返回一個錯誤頁面。(不SQL)PHP郵件命令
這裏是我的代碼遠
$getdisputes = mysql_query("SELECT * FROM `disputedetails` WHERE `invno` = '$invoiceno'") or die(mysql_error());
//send email
$to = "".$disputeemail."";
$subject = "Dispute submitted";
$from = "[email protected]"
$headers = "From:" . $from;
$message1 = "Store ".$username. " has submitted a dispute on invoice number ".$invoiceno;
// foreach line in disputedetails file for that invoice number, add to $message item, desc and
while ($info = mysql_fetch_array($getdisputes)) {
$message = $message1 + "\n <b>Invoice Number: </b>".$info['invno']." <b>Item ID:</b> ".$info['itemid']." <b>Description: </b>".$info['description']." <b>Disputed Quantity:</b> ".$info['disputeqty']." Reason: ".$info['reason'].".";
}
mail($to,$subject,$message,$headers);
任何想法是什麼造成的問題?
,什麼是錯誤?如果沒有SQL結果,那麼while循環將不會執行,並且'$ message'永遠不會被設置。 – sachleen
更具體一點,我們現在不看你的電腦。 –
這是我見過的最可笑的PHP行:'$ to =「」。$ disputeemail。「」;' – keyboardSmasher