Sizce bir yerde yanlışlık yapıyor olabilimiyim ?
Birde boşluk bırakınca zoronlu alanlar aşılıyor bunu nasıl yapabilirm
Boş mail gitmesi sunucu ile alakalı olabilir boş gidenler dolu sipariş olabilir mi ?
<?php
if ( $_POST ){
$name=$_POST['name'];
$phone=$_POST['phone'];
$text=$_POST['text'];
$urun=$_POST['urun'];
$ipadress=$_SERVER['REMOTE_ADDR'];
$date = date("d.m.Y");
$time = date("H:i:s");
include 'class.phpmailer.php';
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->SMTPAuth = true;
$mail->Host = 'mail.sitemiz.com';
$mail->Port = 587;
$mail->SMTPSecure = 'tls';
$mail->Username = 'sonsiparis@sitemiz.com';
$mail->Password = 'şifremiz';
$mail->SetFrom($mail->Username, 'xxxx');
$mail->AddAddress('gidecek mail gmail.com', 'xxxx');
$mail->CharSet = 'UTF-8';
$mail->Subject = 'Sipariş';
$content = "<h2>Son Siparis </h2> <p><b>İsim:</b>$name</p> <p><b>Telefon:</b>$phone</p><p><b>Adres:</b>$text</p> <p><b>Ürün:</b>$urun</p><p><h5>Date: $date . $time </h5></p> <p><h5>IP Adress of User: $ipadress</h5> </p></p>";
$mail->MsgHTML($content);
if($mail->Send()) {
// e-posta başarılı ile gönderildi
echo '<h1>Siparis Talebiniz Basari ile alindi.Birazdan Satis ve Destek Hatti Tarafindan aranip bilgilendirileceksiniz.</h1><br><center> <img src="https://www.svgimages.com/svg-image/s4/tick-big-icon-256x256.png""> </center>;';
} else {
// bir sorun var, sorunu ekrana bastıralım
echo '<div class="error">'.$mail->ErrorInfo.'</div>';
}
}
?><div class="mavibg" style="padding:1%;"> <div class="beyazform" id="gsf"> <form action="siparisformu.php" method="post" name="form2" target="_parent" onsubmit="return form_kontrol()" class="arama"> <strong><font color="red"> İNDİRİMLİ SİPARİŞ FORMU<br> <font color="black"><font size="+1">KAPIDA KREDİ KARTI VEYA NAKİT ÖDEME KOLAYLIĞIYLA 30 GÜN İADE GARANTİSİ</font></font></font></strong> <div class="input"><input type="text" name="name" id="name" placeholder="Adınız ve Soyadınız" required></div> <div class="input"><input type="tel" name="phone" id="phone" placeholder="GSM Numaranız" required></div> <font color="black"> <font color="white"> .</font> Adres Bilgileriniz </font> <div class="input"><input type="text" name="text" style="height:150px;" placeholder=""></div> <div class="siparisform"> <strong><font color="red">Paket Seçiminiz</font></strong> <div class="radyo"> <input id="radio3" type="radio" name="urun" value="1 KUTU"><label for="radio3"><span><span></span></span> <div class="tik"> <b>1 KUTU <font color="red"> 29 TL</font> + Kargo</b> <font color="red"><small>+ 10 TL KARGO ÜCRETİ BULUNMAKTADIR</small></font> </div> </label></div> <div class="radyo forbg"> <input id="radio4" type="radio" name="urun" value="3 + 3 TOPLAM 6 KUTU" checked><label for="radio4"><span><span></span></span> <div class="tik"> <b>3 + 3 TOPLAM 6 KUTU<font color="red"> 99 TL</font> </b> <font color="red"><small>KARGO ÜCRETSİZ</small></font> </div> </label></div> </div> <div class="button"><button type="submit" class="ucmgonder">HEMEN SİPARİŞ VER</button><br> </form> </div></div>