Şimdi Ara

PHP Contact Forum SORUNU

Bu Konudaki Kullanıcılar:
1 Misafir - 1 Masaüstü
5 sn
2
Cevap
0
Favori
528
Tıklama
Daha Fazla
İstatistik
  • Konu İstatistikleri Yükleniyor
0 oy
Öne Çıkar
Sayfa: 1
Giriş
Mesaj
  • Arkadaşlar her şeyim tamam hiç bir sıkıntı yok fakat mail yollamıyor hiç bir tepkime vermiyor sebebi nedir kafayı yemek üzereyim.

    PHP KODU (alici@siteadi.com ve Alici kisimlarini ben değiştiriyorum şimdi gizlilik için öyle yaptım) :
    <script> 
    function clearForms()
    {
    var i;
    for (i = 0; (i < document.forms.length); i++) {
    document.forms[i].reset();
    }
    $('.alert-box.success').fadeOut(200);
    }
    </script>
    <?php

    $name = trim($_POST['name']);
    $email = $_POST['email'];
    $comments = $_POST['comments'];

    $site_owners_email = 'alici@siteadi.com'; // Replace this with your own email address
    $site_owners_name = 'alici'; // replace with your name

    if (strlen($name) < 2) {
    $error['name'] = "Please enter your name";
    }

    if (!preg_match('/^[a-z0-9&\'\.\-_\+]+@[a-z0-9\-]+\.([a-z0-9\-]+\.)*+[a-z]{2}/is', $email)) {
    $error['email'] = "Please enter a valid email address";
    }

    if (strlen($comments) < 3) {
    $error['comments'] = "Please leave a comment.";
    }

    if (!$error) {

    require_once('phpMailer/class.phpmailer.php');
    $mail = new PHPMailer();

    $mail->From = $email;
    $mail->FromName = $name;
    $mail->Subject = "Contact Form";
    $mail->AddAddress($site_owners_email, $site_owners_name);
    $mail->Body = $comments;

    $mail->Send();

    echo "<div data-alert class='alert-box success'>Thanks " . $name . ". Your message has been sent.<a href='#' class='close' onclick='clearForms()'>×</a></div>";

    } # end if no error
    else {

    $response = (isset($error['name'])) ? "<div class='alert-box alert'>" . $error['name'] . "</div> \n" : null;
    $response .= (isset($error['email'])) ? "<div class='alert-box alert'>" . $error['email'] . "</div> \n" : null;
    $response .= (isset($error['comments'])) ? "<div class='alert-box alert'>" . $error['comments'] . "</div>" : null;

    echo $response;
    } # end if there was an error sending

    ?>



    < Bu mesaj bu kişi tarafından değiştirildi Pazzolu -- 9 Eylül 2014; 11:39:25 >







  • 
Sayfa: 1
- x
Bildirim
mesajınız kopyalandı (ctrl+v) yapıştırmak istediğiniz yere yapıştırabilirsiniz.