If you have set Cron for CakePHP, then most likely you’ve read this guide. After following the described actions in it, everything works fine. But there’s a small problem with sending of mails, since consequently Cron is often used.
If you use the $this->Html->url() function in the mail templates by transmitting true as the second parameter in order to substitute the website address in the resulting line, while sending via Cron it will not happen. The reason of it – Cake cannot guess for which website the request has been implemented as there’s no request.
The resolution of this problem is a slight amendment of the file created in the above guide. After the line
define('CRON_DISPATCHER',true); </pre <p align="justify">Insert the lines <pre lang="Java"> define('FULL_BASE_URL', 'http://site.com'); Configure::write('App.base', '/');
The first line defines the website address, the second line is needed personally in my server configuration. Full path has substituted in the address to the cron.php file without it.