0

我正在使用 CakePHP 开发我的应用程序。现在我正在尝试发送带有附件文件'ics'的电子邮件,但我收到一个错误'找不到文件......'这是我到目前为止所做的:

$Email = new CakeEmail();
$Email->to('admin2@gmail.com');
$Email->subject('TEST');
$Email->replyTo('Company@gmail.com');
$Email->from (array('Company@gmail.com'=>'Company'));

$Email->attachments (array(array('file'=>ROOT.'/app/webroot/files/calendar.ics','mimetype'=>'text/Calendar')));
$Email->sendAs = 'html';
if($this->Email->send()){
$this->Session->setFlash("Email Sent");}
else {
$this->Session->setFlash("Email Not Sent");}
}
4

0 回答 0