Php Magento在日常cron作业完成后发送电子邮件

Php Magento在日常cron作业完成后发送电子邮件,php,email,magento,cron,Php,Email,Magento,Cron,我已经编写了一个php脚本来进行日常处理,并希望向几个管理员发送一封电子邮件,其中包含作业流程的html日志文件(我在日常流程脚本中自动创建),以确认完成。有没有一种简单的方法可以通过在脚本末尾添加代码来发送电子邮件 谢谢 标记$info='Log ReportStuff here'; $mail=Mage::getModel('core/email'); $mail->setToName('Joe Smith'); $mail->setToEmail('joe。smith@whatever.c

我已经编写了一个php脚本来进行日常处理,并希望向几个管理员发送一封电子邮件,其中包含作业流程的html日志文件(我在日常流程脚本中自动创建),以确认完成。有没有一种简单的方法可以通过在脚本末尾添加代码来发送电子邮件

谢谢 标记

$info='Log ReportStuff here';
$mail=Mage::getModel('core/email');
$mail->setToName('Joe Smith');
$mail->setToEmail('joe。smith@whatever.com');
$mail->setBody($info);
$mail->setSubject('事件日志-'。日期(“m/d/Y H:i:s”);
$mail->setFromEmail('yoursite@sitename.com');
$mail->setFromName('事件日志');
$mail->setType('html');
$mail->send();

首先,您应该共享您的代码页,我们可以帮助您;其次,您可以通过PHPMailer来完成。谢谢,这正是我所需要的!
        $info = '<table><tr><td>Log Report</td></tr><tr><td>Stuff goes here</td></tr></table>';

        $mail = Mage::getModel('core/email');
        $mail->setToName('Joe Smith');
        $mail->setToEmail('joe.smith@whatever.com');
        $mail->setBody($info);
        $mail->setSubject('Event Log - ' . date("m/d/Y H:i:s"));
        $mail->setFromEmail('yoursite@sitename.com');
        $mail->setFromName('Event Log');
        $mail->setType('html');
        $mail->send();