我在窗體上實現了這個http://www.websitecodetutorials.com/code/jquery-plugins/jquery-ajaxsubmit.php教程,並且表單成功運行並在提交時顯示謝謝div。但問題是我不接受任何電子郵件,似乎PHP郵件程序無法正常工作。使用PHP的Ajax表單提交錯誤郵件程序
請參考下面
<?php
// Insert your email/web addresses and correct paths
$mailto = '[email protected]' ;
$from = "[email protected]" ;
$formurl = "http://astonstorlin.co.uk/citycoaches3/formmail.php" ;
$errorurl = "http://astonstorlin.co.uk/citycoaches3/error.php" ;
$thankyouurl = "http://astonstorlin.co.uk/citycoaches3/thankyou.php" ;
// Place Your Form info here...
$pickuppoint = ($_POST['pickuppoint']);
$destination = ($_POST['destination']);
// Check If Empty
// Add more Validation/Cleaning here...
// Place your Corresponding info here...
$message =
"Pick Point: $pickuppoint\n\n" .
"Destination: $destination\n\n" .
"noppl: $noppl\n\n"
;
// Leave Alone
mail($mailto, $from, $message,
"From: \"$name\" <$email>" . $headersep . "Reply-To: \"$name\" <$email>" . $headersep);
header("Location: $thankyouurl");
exit ;
?>
檢查與SMTP有關的php.ini配置以及錯誤日誌,如果仍然卡住,請在這裏發佈。另外,告訴我們您是否可以運行php並在不使用AJAX調用的情況下收到電子郵件。 –
看來你正在使用默認的PHP郵件功能而不是PHP Mailer –