你知道什么是语法错误引用吗?
这是我正在使用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();
Run Code Online (Sandbox Code Playgroud)
注意:我正在发送电子邮件给我自己进行测试.