• 08-03-2015, 20:31:02
    #1
    Siteme mail formu eklemeye çalışıyorum (wp)

    formu ekledim. kendi mail adresimi yazdım.

    Denemek için bir mail göndermek istiyorum ama aşağıdaki hatayı alıyorum :S

    Message not sent. Please make sure you're not running this on localhost and also that you are allowed to run mail() function from your webserver


    hostun mail sistemini denedim gmail e sorunsuz mail gönderdi.



    send.php

    <?php
    error_reporting(E_NOTICE);

    function valid_email($str)
    {
    return ( ! preg_match("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix", $str)) ? FALSE : TRUE;
    }

    if($_POST['first_name']!='' && $_POST['last_name']!='' && $_POST['e_mail']!='' && valid_email($_POST['e_mail'])==TRUE && strlen($_POST['message'])>30)
    {
    $to = 'xxxxx@gmail.com';
    $headers = 'From: '.$_POST['e_mail'].''. "\r\n" .
    'Reply-To: '.$_POST['e_mail'].'' . "\r\n" .
    'X-Mailer: PHP/' . phpversion();
    $subject = "Hello! I'm testing my new ajax email that I got from roscripts.com";
    $message = htmlspecialchars($_POST['message']);

    if(mail($to, $subject, $message, $headers))
    {//we show the good guy only in one case and the bad one for the rest.
    echo 'Thank you '.$_POST['first_name'].'. Your message was sent';
    }
    else {
    echo "Message not sent. Please make sure you're not
    running this on localhost and also that you
    are allowed to run mail() function from your webserver";
    }
    }
    else {
    echo 'Please make sure you filled all the required fields,
    that you entered a valid email and also that your message
    contains more then 30 characters.';
    }
    ?>
  • 08-03-2015, 21:07:33
    #2
    Kimlik doğrulama veya yönetimden onay bekliyor.
    Localhosta baglanilamıyor diyor. SMTP izni var mı?
  • 08-03-2015, 23:56:05
    #3
    Kimlik doğrulama veya yönetimden onay bekliyor.
    Hosting firmanızda mail fonksiyonu kapalıdır büyük ihtimal wordpress smtp eklentisini kullanarak göndermeyi denediniz mi?
  • 08-03-2015, 23:57:58
    #4
    Üyeliği durduruldu
    smtp portuyla ayar yapın hocam mail fonksiyonuyla değil
  • 09-03-2015, 20:04:15
    #5
    Sanırım hosting ile alakalı bir durum. Hosting sağlayıcısı ile bir görüşeyim o zaman.