我的代码:
$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');
}
是检查这个的正确方法吗?
答案 0 :(得分:0)
试试这个,
if(!$emailTemplate->send($receiverMail,$receiverName, $post)) {
throw new Exception('Not Sent');
}