繁体   English   中英

php mail()函数花费太多时间在centos6服务器上执行

[英]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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM