0

登录时,用户的详细信息会被记录到数据库中,但不会发送电子邮件以激活帐户。它显示以下错误:完成:

( ! ) Warning: mail() [<a href='function.mail'>function.mail</a>]: Failed to connect to mailserver at &quot;mail.YourDomain.com&quot; port 25, verify your &quot;SMTP&quot; and &quot;smtp_port&quot; setting in php.ini or use ini_set() in C:\wamp\www\form\index2.php on line 61
Call Stack
#   Time    Memory  Function    Location
1   0.0006  385856  {main}( )   ..\index2.php:0
2   0.0078  398648  mail ( )    ..\index2.php:61
Thank you for registering! A confirmation email has been sent to divschari@gmail.com Please click on the Activation Link to Activate your account

激活账户的代码是:

    if (mysqli_affected_rows($dbc) == 1) { //If the Insert Query was successfull.

                // Send the email:
                $message = " To activate your account, please click on this link:\n\n";
                $message .=WEBSITE_URL .'activate.php?email='. urlencode($Email) . "&key=$activation";

                mail($Email, 'Registration Confirmation', $message, 'From:'.EMAIL);

                // Flush the buffered output.

                // Finish the page:
                echo '<div class="success">Thank you for
registering! A confirmation email
has been sent to ' . $Email .
                    ' Please click on the Activation Link to Activate your account </div>';

            } else { // If it did not run OK.
                echo '<div class="errormsgbox">You could not be registered due to a system
error. We apologize for any
inconvenience.</div>';
            }

        } else { // The email address is not available.
            echo '<div class="errormsgbox" >That email
address has already been registered.
</div>';
        }

对 php.ini 进行了更改,但代码中的错误仍然存​​在。

4

0 回答 0