我该如何解决 php 邮件页面上的这个警告
how do i sort out this warning on my php mail page
我尝试使用我的 php 邮件功能发送电子邮件,但我在处理过程中收到此警告
警告:mail():依赖系统的不安全
时区设置。你是
需要才能使用
date.timezone 设置或
date_default_timezone_set()
功能。如果您使用了这些方法中的任何一种并且您是
仍然收到这个警告,你
很可能拼错了
时区标识符。我们
select编辑时区 'UTC'
现在,但请将 date.timezone 设置为 select 您的
时区。在
我的问题是如何固定时间让我的 php 邮件功能在我的 php 邮件页面上读出这个警告
这是我的代码:
$to = xvy@gmail.com $message = yes go email;
$subject = 'the subject';
$time = date_default_timezone_set('Africa/Lagos');
$headers = 'From: stringemail@gm.Com';
$go = mail($to, $subject, $message, $headers);
if ($go)
{
echo 'good result';
}
非常感谢
您需要为整个 PHP 环境定义时区。
您可以在脚本中使用 PHP 函数 date_default_timezone_set() with the timezone List of Supported Timezones:
<?php
date_default_timezone_set('Africa/Lagos');
// rest of your script goes here...
我尝试使用我的 php 邮件功能发送电子邮件,但我在处理过程中收到此警告
警告:mail():依赖系统的不安全 时区设置。你是 需要才能使用 date.timezone 设置或 date_default_timezone_set() 功能。如果您使用了这些方法中的任何一种并且您是 仍然收到这个警告,你 很可能拼错了 时区标识符。我们 select编辑时区 'UTC' 现在,但请将 date.timezone 设置为 select 您的 时区。在
我的问题是如何固定时间让我的 php 邮件功能在我的 php 邮件页面上读出这个警告 这是我的代码:
$to = xvy@gmail.com $message = yes go email;
$subject = 'the subject';
$time = date_default_timezone_set('Africa/Lagos');
$headers = 'From: stringemail@gm.Com';
$go = mail($to, $subject, $message, $headers);
if ($go)
{
echo 'good result';
}
非常感谢
您需要为整个 PHP 环境定义时区。
您可以在脚本中使用 PHP 函数 date_default_timezone_set() with the timezone List of Supported Timezones:
<?php
date_default_timezone_set('Africa/Lagos');
// rest of your script goes here...