How to send email in CakePHP?

First of all, you should ensure the class is loaded using App::uses():

 

Using CakeEmail is similar to using EmailComponent. But instead of using attributes you use methods. Example:

 

You can configure SSL SMTP servers such as Gmail. To do so, prefix the host with 'ssl://' and configure the port value accordingly. Example:

 

You can also use tls:// to prefer TLS for connection level encryption.

Share This:

Leave a Reply

Your email address will not be published. Required fields are marked *