在php邮件中重复区域

时间:2017-01-02 01:34:30

标签: php email

我在标题中使用了一个简单的php部分来发送mysqli查询的内容(在这种情况下是三个查询的组合 - 'ORDER'有发货详细信息,'CUSTOMER'包含客户的电子邮件详细信息,和'PRODLIST'有一个进入购物车的产品清单)

我将以下脚本放在一起,尝试收集“ORDER”详细信息,并添加重复区域以添加“PRODLIST”查询中的所有记录。

它不起作用,我想知道这是否可能,如果没有,是否有一个解决方案可以让我发送一个包含完整详细信息的简单html电子邮件?

两个查询都在运行,它们在实际网页的屏幕上列出,但邮件代码没有响应,导致页面无法加载。

$to = 'RECIPIENT REMOVED';

$subject = "order from  " . $ORDER->getColumnVal("CUSTOMER_NAME");

$headers = "From: " . $CUSTOMER->getColumnVal("EMAIL") . "\r\n";
$headers .= "Reply-To: ". $CUSTOMER->getColumnVal("EMAIL") . "\r\n";
$headers .= "BCC: info@sigwebdesign.com\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";$from = "<".$CUSTOMER->getColumnVal("EMAIL").">";

$message = '<html><body>';
$message .= '<p>The following order has been received</p>';
$message .= "Delivery Type: " . $ORDER->getColumnVal("DELIVERY_TYPE") . "<br>";
$message .= "<b>Delivery Date: " . $ORDER->getColumnVal("DELIVERY_DATE") . "<br><br><br></b>";
$message .= "Company: " . $ORDER->getColumnVal("CUSTOMER_NAME") . "<br>";
$message .= "Contact: " . $ORDER->getColumnVal("PLACED_BY") . "<br><br>";
$message .= "Address: " . $ORDER->getColumnVal("DELIVERY_ADDRESS") . "<br>";
$message .= "Address: " . $ORDER->getColumnVal("CITY") . "<br>";
$message .= "Address: " . $ORDER->getColumnVal("STATE") . "<br>";
$message .= "Address: " . $$ORDER->getColumnVal("ZIP") . "<br><br><br>";

while(!$PRODLIST->atEnd()) {
$message .= "ITEM: " . $PRODLIST->getColumnVal("GENUS")." ".$PRODLIST->getColumnVal("VARIETY") . "<br>";
$message .= "QTY: " . $PRODLIST->getColumnVal("QUANTITY") . "<br>";
$PRODLIST->moveNext();
}
$PRODLIST->moveFirst();

$message .= "Total Cost: " . $_SESSION['fullcost'] . "<br><br><br>";
$message .= "This price does not include shipping, and applicable taxes. <br> Your order will be processed, and a final confirmation will be sent to you by email or by phone. <br><br>";

$message .= '</html></body>';


mail($to,$subject,$message,$headers);

1 个答案:

答案 0 :(得分:0)

所以我解决了。我添加了额外的&#34; $&#34;在编码方面,它在工作中投入了大量的扳手。

所以答案(至少注意到自己)是检查并仔细检查代码!