錯誤:可用 埃羅吶Linha:#3274 :: date_default_timezone_get():這是不是安全的依靠系統的時區設置。您需要需要才能使用date.timezone設置或date_default_timezone_set()函數。如果您使用這些方法中的任何一種,並且仍然收到此警告,則很可能是拼寫錯誤的時區標識符。我們現在選擇了「UTC」時區,但請設置date.timezone以選擇您的時區。 C:\ AppServ \ www \ class \ phpmailer.class.php Erro no envio do電子郵件:SMTP連接()失敗。PHPMailer的date_default_timezone_get():這是不是安全的依靠系統的時區設置
public static function rfcDate()
{
// Set the time zone to whatever the default is to avoid 500 errors
// Will default to UTC if it's not set properly in php.ini
date_default_timezone_set(@date_default_timezone_get());
return date('D, j M Y H:i:s O');
}
問題中的代碼不是用戶代碼。它是PHPMailer的一部分,但這個答案也是正確的。 – geekasylum