-2
這裏是我的代碼。我無法顯示錯誤消息。只發郵件不發送。這種方法有什麼問題?jQuery/PHP在mousedown鏈接事件上發送電子郵件
<a id="target" href="http://www.mylink.wav">mylink</a>
<script type="text/javascript">
$(function() {
$("#target").mousedown(function() {
$.post(
"sendemail.php",
{ name: "John" }
);
});
});
</script>
<?php
if($_POST)
{
$mail = "myemail.email.com"
$name = $_POST['name'];
$subject = 'My subject';
$to = "[email protected]";
$message = "My message: ".$name."<br />";
$headers = "From: $mail \n";
$headers .= "Reply-To: $mail \n";
$headers .= "MIME-Version: 1.0 \n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1 \n";
}
?>
感謝您的建議以解決此問題。
嘿,這工作!謝謝。 –
我很高興它幫助:)! – DarioBB