Проблема с почтовым транспортом в Cakephp 3 - PullRequest
0 голосов
/ 26 марта 2019

У меня проблема с транспортом электронной почты в моем Cakephp 3. Я устанавливаю транспорт электронной почты по умолчанию в Debug, и Cakephp 3 сказал мне, что у меня нет ... транспорта электронной почты.

My Error

Я устал менять имя Email Transport, className и включить его в Mailer, но ничего не происходит.

Вот мой код в 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),
        ],
    ],

    /**
     * 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',
        ],
    ],

Мой CountForm :: _ execute ()

protected function _execute(array $data)
    {
        $Mail = new Email('default');

        return ($this->getMailer('Counter', $Mail)->send('sendCounterFromEbok', [$data]) && $this->getMailer('Counter', $Mail)->send('greetingsFromEbok', [$data]));
    }

Моя версия CakePhp - 3.7.0

...