2

私のphp.iniは次のようになります:

    ; For Win32 only.
    ; http://php.net/smtp
    SMTP = localhost
    ; http://php.net/smtp-port
    smtp_port = 25

    ; For Win32 only.
    ; http://php.net/sendmail-from
    sendmail_from = you@yourdomain

    ; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
    ; http://php.net/sendmail-path
    sendmail_path = "/usr/sbin/sendmail -t -i -f akeel_mn@yahoo.com"

私のphpコードは次のようになります:

    <?php
    if(isset($_REQUEST['mail']))
    {
$success = mail("akeel26@gmail.com","hello","Welcome to our site!");
if($success)
{
    echo 'mail send';
}
else
{
    echo 'error';
}
    }
    ?>

プログラムを実行すると、メール送信として表示されますが、メールが目的の受信者に配信されません..誰かが何が悪いのか知っていますか? php.ini 以外に行うべき設定はありますか?

4

1 に答える 1

0

電子メールまたは自宅からのホスティングをサポートするサイトでホストされていますか? 多くの場合、家庭の ISP プロバイダーはすべての発信ポート 25 トラフィックをブロックします。そのため、キューに置かれ、タイムアウトとして表示されます。

また、ヘッダーが欠落していることにも気付きました。それが違いを生むかどうかはわかりません。

$to = "whoever@wherever.com;
$subject = "About mail";
$message = "something to say"
$headers = "From: noreply@wherever.com";
mail($to,$subject,$message,$headers);
于 2012-11-12T16:28:01.570 に答える