发送带有编码器的电子邮件SMTP时出现时间错误


Time error when sending email SMTP with codeigniter - mediatemple hosting

我正在使用codeigniters email helper (SMTP)从我的网站发送电子邮件

电子邮件成功发送到我的收件箱,但我收到以下错误:

A PHP Error was encountered
Severity: Warning
Message: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Los_Angeles' for 'PST/-8.0/no DST' instead
Filename: libraries/Email.php
Line Number: 704

我最近把我的主机切换到meditemple,以前没有收到过这样的消息。我是否需要指定某个地方的时间格式或时区?

php.ini文件中设置date.timezone,警告将消失。

我相信MediaTemple允许你通过在你的主目录中包含一个php.ini来编辑你的php.ini设置。

如果你没有更新php.ini的权限(通常你没有),
您可以将这一行添加到PHP脚本中:-

date_default_timezone_set("Asia/Singapore"); <-- replace to your desire city

这里有关于这个函数的更多文档:http://uk.php.net/date_default_timezone_set