In einem benutzerdefinierten Modul verwende ich diese Funktion, um E-Mails zu senden:
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;
}
Ich versuche, 2 Anhangsdateien in derselben E-Mail zu senden.
Wie kann ich das tun, ohne das Mage_Core_Model_Email_Template-Modell zu verwenden?
Vielen Dank für die Hilfe.