在自定义模块中,我使用此功能发送电子邮件:
public function sendMail($errorCod, $errorMsg) {
$mail = Mage::getModel('core/email');
$recipients = array(
Mage::getStoreConfig('trans_email/ident_custom1/name') => Mage::getStoreConfig('trans_email/ident_custom1/email'),
Mage::getStoreConfig('trans_email/ident_custom2/name') => Mage::getStoreConfig('trans_email/ident_custom2/email')
);
foreach ($recipients as $recipient):
$mail->setToEmail($recipient);
$mailBody = "<b>Error Code: </b>".$errorCod."<br />";
$mailBody .= "<b>Error Massage: </b>".$errorMsg."<br />";
$mail->setBody($mailBody);
$mail->setSubject('Lorem Ipsum');
$mail->setFromEmail(Mage::getStoreConfig('trans_email/ident_general/email'));
$mail->setFromName("Lorem Ipsum");
$mail->setType('html');
try {
$mail->send();
}
catch (Exception $e) {
}
endforeach;
}
我尝试在同一封电子邮件中发送2个附件文件。
不使用Mage_Core_Model_Email_Template模型,该怎么做。
非常感谢您的帮助。