Help me! cakephp Email - Godaddy Hosting


I require your help to solve a problem; It turns out that I want to send an email, and I get an error “SMTP Timeout”. It should be noted that I have the application in a hosting of Godaddy. I attach the configuration.

// app.php

'EmailTransport' => [

        'default' => [

            'className' => 'Mail',

            // The following keys are used in SMTP transports

            'host' => 'localhost',

            'port' => 25,

            'timeout' => 30,

            'username' => null,

            'password' => null,

            'client' => null,

            'tls' => null,

            'url' => env('EMAIL_TRANSPORT_DEFAULT_URL', null),



'className' => 'Smtp',

'host' => '',

'port' => 465,

'timeout' => 30,

'user' => '',

'password' => '********',

'tls' => true,




     * Email delivery profiles


     * Delivery profiles allow you to predefine various properties about email

     * messages from your application and give the settings a name. This saves

     * duplication across your application and makes maintenance and development

     * easier. Each profile accepts a number of keys. See `Cake\Mailer\Email`

     * for more information.


    'Email' => [

        'default' => [

            'transport' => 'default',

            'from' => 'you@localhost',

            //'charset' => 'utf-8',

            //'headerCharset' => 'utf-8',


   'laboralmedicMail-profile' => [

        'transport' => 'laboralmedicmail',

        'from' => '',

        'charset' => 'utf-8'



// my controller

public function sendmail()


        $msg='Estimado;Se le comunica que se le ha programado el examen médico en la clínica';

        $subject='Programación de Examen Médico';





            $this->Flash->success(__('Mail Send'));

            return $this->redirect(['action' => 'index']);





            return $this->redirect(['action' => 'index']);



public function sendUserEmail($to,$subject,$msg)


      $email = new Email();    



            ->from(['' => ''])




            ->viewVars(array('msg' => $msg))


            return 1;


Please, I am against the time since I need to deliver the application, I hope you can help me. Thank you so much.

a timeout means that the server couldn’t be reached within a reasonable time.
Are you sure you’ve entered the right host and port?


Yes, I configured the parameters according to the attachment.


Hm… that’s odd…
Could you add a log statement to the email?


This will add it to the CakePHP logs, could you give the output of it to us? (please be sure to redact any sensitive info if any)

I try add log but an error ocurred:

Call to undefined method Cake\Mailer\Email::log()

I solved the problem. Thanks for your help.

Would you mind posting the solution for future visitors?

I configured SSL in Hosting, and used port 25.