Do you know what is syntax error refering?
Here's the code I'm using cakephp
$User = $this->User->read(null,$id);
$this->Email->to = array('name@gmail.com');;
$this->Email->from = 'name@gmail.com';
$this->Email->subject = 'Welcome to our really cool thing';
$this->Email->template = 'simple_message';
$this->Email->sendAs = 'both';
$this->Email->smtpOptions = array(
'port'=>'465',
'timeout'=>'30',
'auth' => true,
'host' => 'ssl://smtp.gmail.com',
'username'=>'name@gmail.com',
'password'=>'********',
);
$this->set('User', $User);
$this->Email->delivery = 'smtp';
$this->Email->send();
NOTE: I'm sending the email to myself for test purposes.