[英]php mail() function taking too much time to execute on centos6 server
我已經編寫了一個小代碼來檢查服務器的速度。 但是,完成執行大約需要60秒。
<?php
$start=time();
$to = "test@gmail.com";
$subject = "This is subject";
$message = "<b>This is HTML message.</b>";
$message .= "<h1>This is headline.</h1>";
$header = "From:test@mydomain.com \r\n";
$header .= "MIME-Version: 1.0\r\n";
$header .= "Content-type: text/html\r\n";
$retval = mail ($to,$subject,$message,$header);
if( $retval == true ) {
echo "Message sent successfully...";
}else {
echo "Message could not be sent...";
}
$after=time();
$total=$after-$start;
echo "</br>";
echo "Total execution time : ".$total." seconds";
?>
可能是什么原因? 如何改善執行時間? 我已經增加了php.ini文件中的內存限制。
這是sendmail郵件服務器的問題。 安裝postfix郵件服務器解決了該問題。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.