2016-04-10 29 views
-2

İletişim formum çalışmıyor. Mesajlar belirtilen e-posta adresine gönderilmez. Form başarıları ancak e-postalar teslim edilmiyor. Diğer soru ise, komut dosyam için çalışmayan etiketler kullanıyorsa başka bir kod var. KullandığımPHP İletişim Formu mail yollamıyor

html kodu: Kullandığım

<form class="form" id="form1" action="mail.php" method="post"> 

    <p class="name"> 
    <input name="name" type="text" class="validate[required,custom[onlyLetter],length[0,100]] feedback-input" placeholder="NAME" id="name" /> 
    </p> 

    <p class="email"> 
    <input name="email" type="text" class="validate[required,custom[email]] feedback-input" id="email" placeholder="E-MAIL" /> 
    </p> 

    <p class="text"> 
    <textarea name="text" class="validate[required,length[6,300]] feedback-input" id="comment" placeholder="WHAT'S UP?"></textarea> 
    </p> 


    <div class="submit"> 
    <input type="submit" name="submit" value="SEND" id="button-blue"/> 
    <div class="ease"></div> 
    </div> 
</form> 

PHP script:

<?php 

// We create a variable for name value 
$name = $_POST['name']; 

// We create a variable for email value 
$email = $_POST['email']; 

// We create a variable for message value 
$message = $_POST['text']; 

// We provide an e-mail address from which the email is sent 
$from = "[email protected]"; 

// Provide the e-mail address on which you want to receive messages 
$to = "[email protected]"; 

// Provide the subject of the e-mail 
$subject = "Contact form from xyz.com"; 

// We prepare the message body 
$emailbody = ""; 
$emailbody .= "Message: " . $message . "\n"; 

// We add UTF-8 to the header of our message 
$header = ""; 
$header .= "From:" . $from . " \n"; 
$header .= "Content-Type:text/plain;charset=utf-8"; 


// Sending message 
$success = mail($subject, $emailbody, $header); 

// Redirect after sending the message 
if ($success){ 
print "<meta http-equiv=\"refresh\" content=\"0;URL=de/confirmation_signup.html\">"; 
} 
else{ 
print "<meta http-equiv=\"refresh\" content=\"0;URL=de/error.html\">"; 
} 
?> 

Herkes form içinde yanlış neler olduğunu bir ipucu var?

cevap

0

Vars posta işlevine yanlış iletiliyorsunuz;

mail($to,$subject, $emailbody, $header); 

Bkz:. Ben ancak benim için işe yaramadı posta işlevi cadı $ fullfilled

+0

http://php.net/manual/en/function.mail.php, hiçbir e-postalar geliyor ben Buna

mail($subject, $emailbody, $header); 

: Bu değiştirin sorunu bulamıyorum. :( –

İlgili konular