使用codeigniter发送电子邮件SMTP时出现时间错误 - mediatemple hosting

时间:2011-12-03 18:19:08

标签: php email codeigniter time smtp

我使用codeigniters电子邮件帮助程序(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

我最近将我的主机切换为mediatemple,之前没有这样的消息。我是否需要在某处或时区指定时间格式?

2 个答案:

答案 0 :(得分:2)

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

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

答案 1 :(得分:1)

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

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

此处有关于此功能的更多文档:http://uk.php.net/date_default_timezone_set