• 03-07-2013, 15:12:06
    #1
    Selam arkadaşlar elimde 1 mail formu var çalışıyor mesaj haricinde konu telefon birkaç form daha ekleyim dedim çalıştıramadım sorun nerde acaba.
    Alttaki orjinal hali.

    <?php
    	if($_GET[send] == 1)
    	{
    		$hata = "";
    		
    		if(!$_POST[isim]){
    			$hata .= "İsim bilgisi yazılmadı!<br />";
    		}
    		if(!$_POST[mesaj]){
    			$hata .= "Mesaj bilgisi yazılmadı!<br />";
    		}
    		if(!$_POST[email]){
    			$hata .= "Email bilgisi yazılmadı!<br />";
    		}else if(!filter_var($_POST[email], FILTER_VALIDATE_EMAIL)){
    			$hata .= "Email adres yanlış yazıldı!<br />";
    		}
    		
    		if(!$hata){
    			$to			= "***@gmail.com";
    			$konu		= "Web formundan mesaj";
    			
    			$mesaj		= $_POST[mesaj];
    			$mesaj		.= "<p style=\"margin-top: 50px;\"><strong>Bunudene.com</strong> tarafından gönderildi.</p>";
    			$mesaj		.= "<p><img style=\"border: solid 2px #CCC;\" src=\"http://bunudene.com/yakinda.png\" /></p>";
    			
    			$headers	= "MIME-Version: 1.0\n";
    			$headers	.= "Content-type: text/html; Charset: UTF-8\n";
    			$headers	.= "From: $_POST[isim] <$_POST[email]>";
    			
    			mail($to, $konu, $mesaj, $headers);
    		}
    	}
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>PHP Mail Gönderimi</title>
    
    <style type="text/css">
    label{
    	display:block;
    	width:100px;
    	float:left;
    }
    input{
    	width:150px;
    	padding:5px;
    	border: solid 1px #999;
    }
    textarea{
    	width:300px;
    	height:100px;
    	padding:5px;
    }
    p{
    	margin: 0 0 10px 0;
    }
    .buton{
    	width:100px;
    	border: none;
    	height:30px;
    }
    .hata{
    	color:#F00;
    	background-color:#EEE;
    	padding:10px;
    }
    .basarili{
    	color:#090;
    	background-color:#EEE;
    	padding:10px;
    }
    </style>
    
    </head>
    
    <body>
    
    <h1>PHP Mail Gönderimi</h1>
    
    <?php
    	if($hata){
    		echo "<p class=\"hata\">$hata</p>";
    	}else if($_GET[send] == 1){
    		echo "<p class=\"basarili\">Mesajınız başarıyla gönderildi.</p>";
    	}
    ?>
    
    <form action="mail.php?send=1" method="post">
    
    	<p>
        	<label>İsim:</label>
        	<input type="text" name="isim" />
        </p>
        <p>
        	<label>E-mail:</label>
        	<input type="text" name="email" />
        </p>
    	<p>
        	<label>Mesaj:</label>
        	<textarea name="mesaj"></textarea>
        </p>
        <p>
        	<label>&nbsp;</label>
        	<input type="submit" value="Gönder" class="buton" />
        </p>
    
    </form>
    
    </body>
    </html>
  • 03-07-2013, 15:46:55
    #2
    Kimlik doğrulama veya yönetimden onay bekliyor.
    Hosting sağlayıcınız mail() fonksiyonunu devre dışı bırakmış olabilir. STMP protokolüne geçiş yapabiliriz. (bkz: phpmailer)
  • 03-07-2013, 18:04:18
    #3
    Sorun hallolmuştur tşkkürler