DestekHostingVMH adlı üyeden alıntı: mesajı görüntüle
Formunu buradan paylaşabilir misin?
<?php
if ($res['success']) {
$tarih = date("d-m-Y");
$adsoyad = $_POST['adsoyad'];
$telefon = $_POST['telefon'];
$eposta = $_POST['eposta'];
$konu = $_POST['konu'];
$mesaj = $_POST['mesaj'];
$okundu = $_POST['okundu'];
$ekle = $db->prepare("INSERT INTO dilek SET
adsoyad = ?,
telefon = ?,
eposta = ?,
konu = ?,
mesaj = ?,
tarih = ?,
okundu = ?");
$ekle->execute(array(
$adsoyad,
$telefon,
$eposta,
$konu,
$mesaj,
$tarih,
$okundu
));
}
include "sistem/class.phpmailer.php"; // KLASÖR İSMİNİ DEĞİŞTİREBİLİRSİNİZ.
$sql = $db->query("SELECT * FROM ayarlar");
foreach ($sql as $a) {
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->SMTPDebug = 1; // Hata ayıklama değişkeni: 1 = hata ve mesaj gösterir, 2 = sadece mesaj gösterir
$mail->SMTPAuth = true; //SMTP doğrulama olmalı ve bu değer değişmemeli
$mail->SMTPSecure = 'tls'; // Normal bağlantı için tls , güvenli bağlantı için ssl yazın
$mail->Host = "mail.site.com"; // Mail sunucusunun adresi (IP de olabilir)
$mail->Port = 587 ; // Normal bağlantı için 587, güvenli bağlantı için 465 yazın
$mail->IsHTML(true);
$mail->SetLanguage("tr", "phpmailer/language");
$mail->CharSet ="utf-8";
$mail->Username = "mail@site.com"; // Gönderici adresinizin sunucudaki kullanıcı adı (e-posta adresiniz)
$mail->Password = "sifre"; // Mail adresimizin sifresi
$mail->SetFrom("mail@site.com", "Web Sitesi Mesajı"); // Mail atıldığında gorulecek isim ve email (genelde yukarıdaki username kullanılır)
$mail->AddAddress("deneme@site.com"); // Mailin gönderileceği alıcı adres
$mail->Subject = "Yeni Mesaj"; // Email konu başlığı
$mail->Body = "Mesaj icerigi ve metni"; // Mailin içeriği
//--------------- SMTP SUNUCU AYARLARI BİTİŞ -------------------------//


$id = $_GET['id'];

$mail->Body = '<table class="made-in_text" border="0" cellSpacing="10" cellPadding="4" height="254" width="700">
<tr>
<td height="30" width="145" align="left">
<font face="Tahoma" size="2"><strong>Adı Soyadı :</strong></font></td>
<td align="left" width="509" bgcolor="#F6FDEC">
<font size="2" face="Tahoma">'. $_POST['adsoyad'] . '</font></td>
</tr>';
$mail->Body .= '<tr>
<td height="30" align="left">
<font face="Tahoma" size="2"><strong>Telefon Numarası :</strong></font></td>
<td align="left" width="509" bgcolor="#F6FDEC">
<font size="2" face="Tahoma">'. $_POST['telefon'] . '</font></td>
</tr>';

$mail->Body .= '<tr>
<td height="30" align="left">
<font face="Tahoma" size="2"><strong>E-Posta :</strong></font></td>
<td align="left" width="509" bgcolor="#F6FDEC">
<font size="2" face="Tahoma">'. $_POST['eposta'] . '</font></td>
</tr>';
$mail->Body .= '<tr>
<td height="30" align="left">
<font face="Tahoma" size="2"><strong>Konu :</strong></font></td>
<td align="left" width="509" bgcolor="#F6FDEC">
<font size="2" face="Tahoma">'. $_POST['konu'] . '</font></td>
</tr>';

$mail->Body .= '<tr>
<td style="VERTICAL-ALIGN: top; PADDING-TOP: 20px" align="left">
<font face="Tahoma" size="2"><strong>Mesaj :</strong></font></td>
<td align="left" width="509" bgcolor="#F6FDEC">
<font size="2" face="Tahoma">'. $_POST['mesaj'] . '</font></td>
</tr>';

$mail->Body .= '<tr>
<td height="30" align="left">
<strong><font face="Tahoma" size="2">IP Adresi </font></strong><font face="Tahoma" size="2"><strong>:</strong></font></td>
<td align="left" width="509" bgcolor="#F6FDEC">
<font size="2" face="Tahoma">'. $_SERVER['REMOTE_ADDR'] . '</font></td>
</tr></table>';
if(!$mail->Send()){
echo "Email Gönderim Hatasi: ".$mail->ErrorInfo;
} else {
echo "Email Gonderildi";
}
}
?>
<!-- Contact Form -->
<form action="index.php?page=iletisim&ticketmesaj=ticketmesaj" method="POST">
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label><?php echo $hdil["had"]; ?> <small>*</small></label>
<input class="form-control" type="text" name="adsoyad" placeholder="Adınız Soyadınız" required="required">
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label><?php echo $hdil["hmail"]; ?> <small>*</small></label>
<input class="form-control required email" type="eposta" name="eposta" required="required">
</div>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label><?php echo $hdil["htel"]; ?> <small>*</small></label>
<input class="form-control required" type="text" name="telefon" placeholder="Telefon " required="required">
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label><?php echo $hdil["hkonu"]; ?> <small>*</small></label>
<input class="form-control" type="text" name="konu" required="required">
</div>
</div>
</div>
<div class="form-group">
<label><?php echo $hdil["hmesaj"]; ?></label>
<textarea name="mesaj" class="form-control required" rows="5" placeholder="Mesajınız" required="required"></textarea>
</div>
<div class="form-group">
<input type="hidden" name="okundu" value="0" />
<button type="Send" class="btn btn-dark btn-theme-colored btn-flat" data-loading-text="Lütfen bekleyin..."><?php echo $hdil["hgonder"]; ?></button>
</div>
            </form>
Bu şekilde üstad buyur.