• 10-06-2020, 04:46:56
    #1
    Kimlik doğrulama veya yönetimden onay bekliyor.
    Html temada, form-validate.js ve mail.php dosyaları var. İlgili satıra mail adresi yazsam da gönderi başarısız.

    <?php
        
        if( empty( $_POST['token'] ) ){
            echo '<span class="notice">Error!</span>';
            exit;
        }
        if( $_POST['token'] != 'FsWga4&@f6aw' ){
            echo '<span class="notice">Error!</span>';
            exit;
        }
        
        $name = $_POST['name'];
        $from = $_POST['email'];
        $phone = $_POST['phone'];
        $subject = stripslashes( nl2br( $_POST['subject'] ) );
        $message = stripslashes( nl2br( $_POST['message'] ) );
        
        $headers ="From: Form Contact <$from>\n";
        $headers.="MIME-Version: 1.0\n";
        $headers.="Content-type: text/html; charset=iso 8859-1";
        
        ob_start();
        ?>
            Hi GSRthemes9!<br /><br />
            <?php echo ucfirst( $name ); ?> has sent you a message via contact form on your website!
            <br /><br />
            
            Name: <?php echo ucfirst( $name ); ?><br />
            Email: <?php echo $from; ?><br />
            Phone: <?php echo $phone; ?><br />
            Subject: <?php echo $subject; ?><br />
            Message: <br /><br />
            <?php echo $message; ?>
            <br />
            <br />
            ============================================================
        <?php
        $body = ob_get_contents();
        ob_end_clean();
        
        $to = 'tiogok@gmail.com';
    
        $s = mail($to,$subject,$body,$headers,"-t -i -f $from");
    
        if( $s == 1 ){
            echo '<div class="success"><i class="fa fa-check-circle"></i><h3>Thank You!</h3>Your message has been sent successfully.</div>';
        }else{
            echo '<div>Your message sending failed!</div>';
        }
    
        
    ?>
  • 10-06-2020, 04:52:56
    #2
    echo '<div>Your message sending failed!</div>';
    Bu satırı

    echo '<div>'.error_get_last()['message'] .'</div>';
    Olarak değiştirin, hata mesajına göre ilerlemek daha mantıklıdır.
  • 10-06-2020, 05:46:34
    #3
    tuyo adlı üyeden alıntı: mesajı görüntüle
    Html temada, form-validate.js ve mail.php dosyaları var. İlgili satıra mail adresi yazsam da gönderi başarısız.

    <?php
        
        if( empty( $_POST['token'] ) ){
            echo '<span class="notice">Error!</span>';
            exit;
        }
        if( $_POST['token'] != 'FsWga4&@f6aw' ){
            echo '<span class="notice">Error!</span>';
            exit;
        }
        
        $name = $_POST['name'];
        $from = $_POST['email'];
        $phone = $_POST['phone'];
        $subject = stripslashes( nl2br( $_POST['subject'] ) );
        $message = stripslashes( nl2br( $_POST['message'] ) );
        
        $headers ="From: Form Contact <$from>\n";
        $headers.="MIME-Version: 1.0\n";
        $headers.="Content-type: text/html; charset=iso 8859-1";
        
        ob_start();
        ?>
            Hi GSRthemes9!<br /><br />
            <?php echo ucfirst( $name ); ?> has sent you a message via contact form on your website!
            <br /><br />
            
            Name: <?php echo ucfirst( $name ); ?><br />
            Email: <?php echo $from; ?><br />
            Phone: <?php echo $phone; ?><br />
            Subject: <?php echo $subject; ?><br />
            Message: <br /><br />
            <?php echo $message; ?>
            <br />
            <br />
            ============================================================
        <?php
        $body = ob_get_contents();
        ob_end_clean();
        
        $to = 'tiogok@gmail.com';
    
        $s = mail($to,$subject,$body,$headers,"-t -i -f $from");
    
        if( $s == 1 ){
            echo '<div class="success"><i class="fa fa-check-circle"></i><h3>Thank You!</h3>Your message has been sent successfully.</div>';
        }else{
            echo '<div>Your message sending failed!</div>';
        }
    
        
    ?>
    php mailer kullanın bir de öyle deneyin.
    https://github.com/PHPMailer/PHPMailer