php mailer.php dosyası
<?php
$to = "abc@gmail.com";
$subject = "Contact via website";
$name_field = $_REQUEST['name'];
$email_field = $_REQUEST['email'];
$message = $_REQUEST['message'];
$body = "From: $name_field\n E-Mail: $email_field\n Message:\n $message";
mail($to, $subject, $body);
?>
Burada jquery kodu
$('.submit').click(function(){
$('span.msg').css({'visibility': 'visible'}).text('Sending...');
$.post("mailer.php", $(".contactPage").serialize(),
function(data){
$('span.msg').text('Your Message has been received. Thank you').show();
});
return false;
Burada html kodu
<div class="contactPage">
<label>Name</label>
<input type="text" name="name" class="txt" />
<label>Email</label>
<input type="text" name="email" class="txt" />
<label>Message</label>
<textarea class="txt_area" name="message" rows="5" cols="30"></textarea>
<input type="button" class="submit" value="" />
<span class="msg">Your Message has been received. Thank you</span>
</div>
});
ama boş e-posta alıyorum ....