I am getting:
CakePHP: the rapid development php framework
An Internal Error Has Occurred
Error: An Internal Error Has Occurred.
when un-comment lines below … I have CakePHP 3.2.1 // you know where bug is???
public function emailtothis() {
$email1 = $this->request->data('emailfield');
$id = $this->request->data('idemail');
$listing = $this->Listings->get($id, [
'contain' => ['Users', 'Categories']
]);
$email = new Email('default');
/* $email->setFrom(['yyyy@gmail.com' => 'yyy.town'])
->setTo($email1)
->setSubject($listing->name." - yyy.town")
->send('Share from yyy.town... Name: '.$listing->name);
*/
//die($email1.", ".$listing->url); // this works
return $this->redirect('/listings/view/'.$id);
}