我已經安裝了Apache和Windows 8.1 PHP5,但不能從我的本地網站發送郵件,出現「警告消息:電子郵件()[function.mail]:無法連接到郵件服務器在 「本地主機」 端口25,驗證 「SMTP」 和 「SMTP_PORT」 在php.ini設置或使用的ini_set()在C:\ Web服務器\ APACHE2.2 \ htdocs中\的WebContent \ mailForm.php上線22" 。在下面的PHP代碼,我想它沒關係,因爲它正確地'回聲'。有人可以給出關於發生什麼的任何提示?謝謝。SMTP服務器的問題,PHP郵件
<?php
$first_name = $_POST['first_name'];
$last_name = $_POST['last_name'];
$email = $_POST['email'];
$message = $_POST['message'];
$to = "[email protected]";
$subject = "New_message";
if (($first_name == "") || ($last_name == "") || ($email == "") || ($message == ""))
{
echo '<script type="text/javascript">alert("Fill in all fields")</script>';
}
else
{
mail($to, $subject, $message, "From:" . $first_name . $last_name);
echo "Sucess;
}
?>