CakeDC / users

Users Plugin for CakePHP
https://www.cakedc.com
Other
521 stars 297 forks source link

No emails sent with version 4.2.3 of Cakephp #940

Closed SandroNigro closed 3 years ago

SandroNigro commented 3 years ago

After installing the plugin, having followed the entire installation procedure, I try to register a new user. The user is entered in the table "Users" but I get this error:

_Could not send email: unknown

Toggle Arguments
        // phpcs:disable
        if (!@mail($to, $subject, $message, $headers, $params)) {
            $error = error_get_last();
            $msg = 'Could not send email: ' . ($error['message'] ?? 'unknown');
            throw new CakeException($msg);
        }
        // phpcs:enable
    }
}_

I try the login procedure and it works. Later, I try the logout, obtaining:

Deprecated (16384): Config key `expire` is deprecated, use `expires` instead. - /home/customer/www/XXX/public_html/YYY/vendor/cakephp/authentication/src/Authenticator/CookieAuthenticator.php, line: 197
 You can disable all deprecation warnings by setting `Error.errorLevel` to `E_ALL & ~E_USER_DEPRECATED`, or add `vendor/cakephp/authentication/src/Authenticator/CookieAuthenticator.php` to  `Error.ignoredDeprecationPaths` in your `config/app.php` to mute deprecations from only this file. [CORE/src/Core/functions.php, line 316]
Deprecated (16384): Config key `httpOnly` is deprecated, use `httponly` instead. - /home/customer/www/XXX/public_html/YYY/vendor/cakephp/authentication/src/Authenticator/CookieAuthenticator.php, line: 197
 You can disable all deprecation warnings by setting `Error.errorLevel` to `E_ALL & ~E_USER_DEPRECATED`, or add `vendor/cakephp/authentication/src/Authenticator/CookieAuthenticator.php` to  `Error.ignoredDeprecationPaths` in your `config/app.php` to mute deprecations from only this file. [CORE/src/Core/functions.php, line 316]
Warning (512): Unable to emit headers. Headers sent in file=/home/customer/www/XXX/public_html/YYY/vendor/cakephp/cakephp/src/Error/Debugger.php line=970 [CORE/src/Http/ResponseEmitter.php, line 71]
Warning (2): Cannot modify header information - headers already sent by (output started at /home/customer/www/XXX/public_html/YYY/vendor/cakephp/cakephp/src/Error/Debugger.php:970) [CORE/src/Http/ResponseEmitter.php, line 168]
Warning (2): Cannot modify header information - headers already sent by (output started at /home/customer/www/XXX/public_html/YYY/vendor/cakephp/cakephp/src/Error/Debugger.php:970) [CORE/src/Http/ResponseEmitter.php, line 197]
Warning (2): Cannot modify header information - headers already sent by (output started at /home/customer/www/XXX/public_html/YYY/vendor/cakephp/cakephp/src/Error/Debugger.php:970) [CORE/src/Http/ResponseEmitter.php, line 197]
Warning (2): Cannot modify header information - headers already sent by (output started at /home/customer/www/XXX/public_html/YYY/vendor/cakephp/cakephp/src/Error/Debugger.php:970) [CORE/src/Http/ResponseEmitter.php, line 235]

I get this with Cakephp version 4.2.3. With version 4.2.2 everything is ok.

SandroNigro commented 3 years ago

Excuse me, my mistake. In the "config/app.php" file I changed the "from" field using my domain. Everything is solved.