send mail with gmail (smtp)


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. $this->Email->smtpOptions = array(
  2. 'port'=>'465',
  3. 'timeout'=>'30',
  4. 'auth' => true,
  5. 'host' => 'ssl://smtp.gmail.com',
  6. 'username'=>'[email protected]',
  7. 'password'=>'yourpassword'
  8. );
  9.  
  10. $this->Email->to = 'test <[email protected]>'; // important: name <mailaddress>
  11. $this->Email->subject = "email di prova";
  12. $this->Email->delivery = 'smtp';
  13. $this->Email->send();

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.