我正在使用magento 1.8.1,我收到通知电子邮件中的缺货错误。我收到这种形式的邮件
Hello Admin.'<br/>Customer'.wants to be notified when the below product is available in our inventory<br/><p>Item Name :</p><p>SKU :</p><p> Search Code :</p><p>Bar Code :</p>
没有任何关于产品的详细信息。
当我签入\ app \ code \ local \ Adodis \ Pincodecheck \ controllers
时代码是:
$to = "sales@abcd.com";
$subject = "Product in demand";
$txt = "Hello Admin.'<br/>Customer'.".$pincode."wants to be notified when the below product is available in our inventory<br/><p>Item Name :".$name."</p><p>SKU :".$sku."</p><p> Search Code :".$scode."</p><p>Bar Code :".$bcode."</p>";
mail($to,$subject,$txt);
请告诉我在此代码中需要修改哪些内容才能获得正确的邮件
答案 0 :(得分:1)
添加这些标题并传递它:
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$to = "sales@abcd.com";
$subject = "Product in demand";
$txt = "Hello Admin.'<br />Customer'.".$pincode."wants to be notified when the below product is available in our inventory<br /><p>Item Name :".$name."</p><p>SKU :".$sku."</p><p> Search Code :".$scode."</p><p>Bar Code :".$bcode."</p>";
mail($to,$subject,$txt, $headers);