小编jua*_*uan的帖子

555 5.5.2语法错误.gmail的smtp

你知道什么是语法错误引用吗?

这是我正在使用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)

注意:我正在发送电子邮件给我自己进行测试.

email smtp

14
推荐指数
2
解决办法
6万
查看次数

标签 统计

email ×1

smtp ×1