0

I'm using CakePHP to develop my application. Now I'm trying to send Email with attachment file 'ics' but i got an error 'File not found ...' Here's what i've done untill now :

$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");}
}
B.O
  • 11
  • 4
  • have you made absolutly sure that the file is at the location you are saying it is? – Alex Stallen Jul 07 '15 at 18:17
  • If recommend using `DS` instead of slashes... I yes that should be the problem... And instead of `ROOT`, try using `APP` and report if it works... – Fr0zenFyr Jul 07 '15 at 18:32
  • Yeah i'v e tried with DS instead of slashes and ROOT by APP but still got the sam erroe 'File not found...' – B.O Jul 07 '15 at 19:16

0 Answers0