index.php - MAIL
<?php
if (isset($_POST["submit"]))
{
// Forms
$name = $_POST['name'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$subject = $_POST['subject'];
$message = $_POST['message'];
// Form Settings
$from = 'Pazgha TV';
$to = '*****@gmail.com';
// Form Template
$body="Gönderen: $name\nE-Posta: $email\nTelefon: $phone\nKonu: $subject\nMesaj: $message";
// Check and Send Email
if (mail ($to, $subject, $body, $from))
{
$result='<div class="alert alert-success"> Mesajınız gönderildi! En kısa zamanda sizinle iletişime geçeceğiz.</div>';
}
else
{
$result="<div class='alert alert-danger'>Mesajınız gönderilirken bir hata oluştu! Lütfen daha sonra tekrar deneyiniz.</div>";
}
}
?>İndex.php - FORM<form class="contact-form" id="contact-form" role="form" method="post" action="index.php"> <div class="row g-4"> <h2 class="fs-1 fw-normal contact-title">Size yardımcı olabilmemiz için, lütfen formu doğru ve eksiksiz doldurun.</h2> <div class="col-md-12 wow fadeInUp" data-wow-duration=".6s" data-wow-delay=".3s"> <input type="text" id="name" name="name" class="form-control input-style-2" placeholder="Ad Soyad" required> </div> <div class="col-md-12 wow fadeInUp" data-wow-duration=".6s" data-wow-delay=".4s"> <input type="email" id="email" name="email" class="form-control input-style-2" placeholder="E-Posta Adresi" required> </div> <div class="col-md-12 wow fadeInUp" data-wow-duration=".6s" data-wow-delay=".4s"> <input type="tel" id="phone" name="phone" class="form-control input-style-2" placeholder="Telefon Numarası (isteğe bağlı)"> </div> <div class="col-md-12 wow fadeInUp" data-wow-duration=".6s" data-wow-delay=".2s"> <select id="subject" name="subject" class="form-control input-style-2"> <option value="" selected>Konu</option> <option value="reklam">Reklam</option> <option value="oneri">Öneri</option> <option value="sikayet">Şikayet</option> <option value="diger">Diğer</option> </select> </div> <div class="col-12 wow fadeInUp" data-wow-duration=".6s" data-wow-delay=".5s"> <textarea class="form-control input-style-2" rows="4" id="message" name="message" placeholder="Mesaj" required></textarea> </div> <div class="col-12 text-center wow fadeInUp" data-wow-duration=".6s" data-wow-delay=".6s"> <button id="submit" name="submit" type="submit" class="theme-btn send-me mt-30 text-center">Gönder</button> </div> <div class="col-12 mt-5 text-center form-message"> <?php echo $result; ?> </div> </div> </form>