I know the title of this post a little bit confusing but let me explain what I want to tell.
You are using CakePHP’s email component and you should set the same information in each time before you send your email like server address, username, password etc.
Just create a new file mailer.php with the following content and drop it into your CakePHP application components folder (I like convention over configuration! ;).
And right now you have a new component with the name Mailer and its server configuration is predefined. You can reuse it without being affected by any kind of mail server change.
You can define a new function inside your controller (_sendEmail() in our case) and make the email sending process more painless.