Error: An Internal Error Has Occurred. tried send email


#1

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);
				
	}

#2
	$email = new Email('default');
	$email->from(['yyy@gmail.com' => 'yyy.town'])
	->to($email1)
	->subject($listing->name." - yyy.town")
	->send('Share from yyy.town... Name: '.$listing->name);	

fixed for cakephp 3.2.1