[英]How to check mail is sent or not in magento?
我的代碼:
$emailTemplate = Mage::getModel('core/email_template')->loadDefault($templateId);
$senderMail = $order->getCustomerEmail();
$senderName = $order->getCustomerName();
$receiverMail = Mage::helper('orderattachments')->getEmailAddress();
$receiverName = Mage::helper('orderattachments')->getName();
$emailTemplate->setTemplateSubject("Order Attachments_ " . $orderId);
$emailTemplate->setSenderEmail($senderMail, $storeId);
$emailTemplate->setSenderName($senderName, $storeId);
$emailTemplate->send($receiverMail,$receiverName, $post);
如何檢查郵件是否發送?
if(!$emailTemplate->getSentSuccess()) {
throw new Exception('Not Sent');
}
檢查這個是正確的方法嗎?
嘗試這個,
if(!$emailTemplate->send($receiverMail,$receiverName, $post)) {
throw new Exception('Not Sent');
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.