CakePHP email: undefined constant DATE_RFC2822. Solution using php 4?
I'm trying to use the Email component. THe problem is that, after sending, I get a warning like undefined constant DATE_RFC2822.... Besides, the emails are received with a 12/31/1969 7:00 PM date on them.
I've done some research and apparently (Use of undefine开发者_JS百科d constant DATE_RFC2822) PHP 4 does not support it, which is the one currently in use in the web server I'm using.
The thing is that in the Control Panel of the webserver there's an option to change the Global PHP version to 5. However, there are many other websites hosted in the same server, so I'm afraid of changing that from 4 to 5 and screwing stuff up. Is that a real risk?
Or better yet, is there any way to fix the date issue without changing the PHP version? I don't see where I could manually add the correct time to the email that I'm sending with the Email component.
Any ideas?
I know this is not the answer you are looking for and you've probably heard it here already, but there really is no excuse to not be using PHP 5 in Q3 2011.
However, as it is just a constant, you could just define it yourself in your bootstrap.php
:
define('DATE_RFC2822', date('D, j M Y H:i:s O')); // Sun, 14 Aug 2005 16:13:03 +0000
精彩评论