【发布时间】:2014-01-03 12:59:51
【问题描述】:
我在 magento 根目录中有以下代码来发送电子邮件。
<?php
require_once('app/Mage.php'); //Path to Magento
umask(0);
Mage::app("default");
$body = "Hi there, here is some body content";
$mail = Mage::getModel('core/email');
$mail->setToName('John');
$mail->setToEmail('ab@example.net');
$mail->setBody($body);
$mail->setSubject('The Subject');
$mail->setFromEmail('yourstore@url.com');
$mail->setFromName("Your Name");
$mail->setType('text');// You can use 'html' or 'text'
try {
$mail->send();
Mage::getSingleton('core/session')->addSuccess('Your request has been sent');
}
catch (Exception $e) {
Mage::getSingleton('core/session')->addError('Unable to send.');
}
?>
如何在此电子邮件中附加多个 csv 文件。(至少 3 或 4 个)。
【问题讨论】:
标签: php magento csv smtp sendmail