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

时间:2022-08-14 18:12:21

I am sending emails from my website using codeigniters email helper (SMTP)

我使用codeigniters电子邮件助手(SMTP)从我的网站发送电子邮件

Emails are being delivered successfully to my inbox BUT I am receiving the following error:

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

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

I have recently switched my hosting to mediatemple and haven't had messages like this before. Do I need to specify the time format somewhere or timezone??

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

2 个解决方案

#1


2  

Set date.timezone in your php.ini file and the warning should go away.

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

I believe MediaTemple allows you to edit your php.ini settings by including a php.ini in your home directory.

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

#2


1  

If you don't have the privileges to update php.ini (usually you don't),
you can add this line to your php script(s) :-

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

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

There's more documentation on this function here: http://uk.php.net/date_default_timezone_set

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

#1


2  

Set date.timezone in your php.ini file and the warning should go away.

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

I believe MediaTemple allows you to edit your php.ini settings by including a php.ini in your home directory.

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

#2


1  

If you don't have the privileges to update php.ini (usually you don't),
you can add this line to your php script(s) :-

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

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

There's more documentation on this function here: http://uk.php.net/date_default_timezone_set

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