HTML sayfası
<form action="" method="mailgonder.php">
<h2 class="lead__subtitle">Bir başvuru bırakın</h2>
<div class="mb-3">
<input class="form-control required" id="adi" name="adi" placeholder="Adınız" type="text">
</div>
<div class="mb-3">
<input class="form-control required" id="soyadi" name="soyadi" placeholder="Soyadınız" type="text">
</div>
<div class="mb-3">
<input class="form-control required" id="eposta" name="eposta" placeholder="E-Posta Adresiniz" type="email">
</div>
<div class="mb-3">
<input class="form-control required" id="telefon" name="telefon" placeholder="Telefon Numaranız" type="text">
</div>
<h6>Dikkat! Yönticimiz sizi arayacaktır.
Anlayışınız için çok teşekkür ederiz</h6>
<div class="form-check">
<input checked type="checkbox" class="form-check-input" id="exampleCheck1">
<label class="form-check-label text-muted" for="exampleCheck1"><a class="text-muted text-decoration-none" href="privacy.html" target="_blank">Gizlilik Politikasını</a> kabul ediyorum</label>
</div>
<div class="mb-3 form-check">
<input checked type="checkbox" class="form-check-input" id="exampleCheck2">
<label class="form-check-label" for="exampleCheck2"><a class="text-muted text-decoration-none">18 yaşın
üzerindeyim</a></label>
</div>
<button type="submit" name="submit" class="btn btn-danger w-100">ücretsiz kayıt</button>
<input type="hidden" name="phonecc" value="" class="phonecc" />
<input type="hidden" name="country" value=""/>
<input type="hidden" name="comment" value="" />
</form>mailgonder.php kodu
<?php
if(isset($_POST['fg-gonder'])){
$kime = "xxx@gmail.com"; // hedef email
$adi = $_POST['adi'];
$soyadi = $_POST['soyadi'];
$eposta = $_POST['eposta'];
$telefon = $_POST['telefon'];
<html>
<head>
<title>Örnek İletişim Formu</title>
</head>
<body>
<p>'.$adi.' '.$soyadi.' aşağıdaki bilgiler ile size form gönderdi</p>
<p><b>İsim:</b> '.$adi.'</p>
<p><b>Soyisim:</b> '.$soyadi.'</p>
<p><b>E-posta:</b> '.$eposta.'</p>
<p><b>Telefon:</b> '.$telefon.'</p>
</body>
</html>';
$header = "Content-type: text/html; charset=utf-8 \r\n";
mail($kime,$konu,$mesaj,$header);
echo "<p class='alert alert-success'>Başarıyla Gönderildi. Teşekkür ederiz " . $adi . ", sizinle iletişime geçeceğiz .</p>";
}
?>
