0

I have:

  1. set up a cakephp 3.8 application.
  2. installed cakedc.users 8.4
  3. succesfully configured the facebook login integration

You can ignore the points 2 and 3 because my problem is on the registration email sending. When i try to sign up a user, the user is correctly added to DB but i can't receive any email. The page returns me:

The "default" transport configuration does not exist.

My app.php is configured as default:

    'EmailTransport' => [
        'default' => [
            'className' => MailTransport::class,
            /*
             * 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),
        ],
    ],
    'Email' => [
        'default' => [
            'transport' => 'default',
            'from' => 'you@localhost',
            //'charset' => 'utf-8',
            //'headerCharset' => 'utf-8',
        ],
    ],

I can't figure out why my "default" emailTransport is not correctly loaded during sending process and so Mail() function returns me this error.

Disu
  • 113
  • 10

2 Answers2

1

I have the answer! I don't know why but in bootstrap.php the row 152:

TransportFactory::setConfig(Configure::consume('EmailTransport'));

was inside a comment. Removing comment configuration has been correctly read.

Disu
  • 113
  • 10
0

You haven't configured your transport for "default". You need to provide proper host, port, username, password to make it work. Follwing is the basic example of gmail transport configuration

'EmailTransport' => [
    'default' => [
        'host' => 'ssl://smtp.gmail.com',
        'port' => 465,
        'username' => 'my@gmail.com',  //Your email id
        'password' => 'secret',   //password for the email id
        'className' => 'Smtp'
        'timeout' => 30,
        'client' => null,
        'tls' => null,
        'url' => env('EMAIL_TRANSPORT_DEFAULT_URL', null),
    ],
],

Learn of configuring email transport.

bikash.bilz
  • 821
  • 1
  • 13
  • 33
  • The message is clear: the transport hasn't be found by cakePhp core. In fact inserting your transport configuration (with one of my Google account credentials) I received the same error. Exploring the core code seems that that transport is not correctly loaded from the configuration file but I have a clean cakePhp installation so it is very strange. – Disu Aug 22 '19 at 09:23