Aşağıdaki kodlar işinizi görecektir yan kısmına açıklama yazdım.
$content .= 'kodlar'; şeklinde yaptıgınızda sizin ilk content verinize ekleme yapar
<!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" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<title>PHPMailer ile E-posta Gönderimi</title>
<style type="text/css">
* {
padding: 0; margin: 0; list-style: none; border: none; font-family: Arial; font-size: 14px
}
textarea, input {
border: 1px solid #ddd;
border-top-color: #aaa;
border-left-color: #aaa;
padding: 7px;
resize: none
}
input:focus, textarea:focus {
outline: 1px solid #205ec1
}
button {
background: #205ec1;
color: #fff;
padding: 7px 13px;
cursor: pointer
}
form {
width: 400px;
margin: 20px auto;
background: #f9f9f9;
padding: 10px;
border: 1px solid #ddd;
border-top-color: #aaa;
border-left-color: #aaa
}
form h3 {
font-size: 21px;
font-weight: normal;
margin-bottom: 10px;
border-bottom: 1px solid #ddd;
padding-bottom: 10px
}
table tr td {
padding: 6px;
}
.success {
border: 1px solid green;
color: green;
padding: 10px;
margin: 20px auto;
width: 400px
}
.error {
border: 1px solid red;
color: red;
padding: 10px;
margin: 20px auto;
width: 400px
}
</style>
</head>
<body>
<?php
if ( $_POST ){
$adsoyad = htmlspecialchars(trim($_POST['adsoyad']));
$fakulte = htmlspecialchars(trim($_POST['fakulte']));
$iletisim = htmlspecialchars(trim($_POST['iletisim']));
$eposta = htmlspecialchars(trim($_POST['eposta']));
$istel = htmlspecialchars(trim($_POST['istel']));
$ceptel = htmlspecialchars(trim($_POST['ceptel']));
$iletisim = htmlspecialchars(trim($_POST['iletisim']));
$liste = htmlspecialchars(trim($_POST['liste']));
$digeryayin = htmlspecialchars(trim($_POST['digeryayin']));
$yayinadi = htmlspecialchars(trim($_POST['yayinadi']));
$yazaradi = htmlspecialchars(trim($_POST['yazaradi']));
$yayinevi = htmlspecialchars(trim($_POST['yayinevi']));
$isbn = htmlspecialchars(trim($_POST['isbn']));
$gorulme = htmlspecialchars(trim($_POST['gorulme']));
include 'class.phpmailer.php';
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->SMTPSecure = "ssl"; // sets the prefix to the servier
$mail->Host = "smtp.gmail.com"; // sets GMAIL as the SMTP server
$mail->Port = 465; // set the SMTP port
$mail->Username = 'mailadresim@gmail.com';
$mail->Password = 'sifre';
$mail->From = $_POST["eposta"];
$mail->FromName = $_POST["adsoyad"];
$mail->AddAddress('mailadresim@gmail.com'); // Name is optional
$mail->CharSet = 'UTF-8';
$mail->Subject = 'Konu';
$content = '<div style="background: #eee; padding: 10px; font-size: 14px">'.$mesaj.'</div>';
$content .= '<div style="background: #eee; padding: 10px; font-size: 14px">'.$iletisim.'</div>'; // bu satiri çoğaltıp istediğiniz bilgileri yazabilirsiniz
$mail->MsgHTML($content);
if($mail->Send()) {
// e-posta başarılı ile gönderildi
echo '<div class="success">E-posta başarıyla gönderildi, lütfen kontrol edin.</div>';
} else {
// bir sorun var, sorunu ekrana bastıralım
echo '<div class="error">'.$mail->ErrorInfo.'</div>';
}
}
?>
<form action="" method="post">
<h3>Kullanıcı Bilgileri</h3>
<table>
<tr>
<td width="108">Adınız Soyadınız</td>
<td width="280"><input type="text" name="adsoyad" style="width: 250px; height: 25px" /></td>
</tr>
<tr>
<td>Fakülteniz</td>
<td><input type="text" name="fakulte" style="width: 250px; height: 25px" /></td>
</tr>
<tr>
<td>İletişim Bilgileriniz</td>
<td><textarea name="iletisim" cols="42" rows="4"></textarea></td>
</tr>
<tr>
<td>E-Mail</td>
<td><input type="email" name="eposta" style="width: 250px; height: 25px" /></td>
</tr>
<tr>
<td>İş Telefonu</td>
<td><input type="text" name="istel" style="width: 250px; height: 25px" /></td>
</tr>
<tr>
<td>Cep Telefonu</td>
<td><input type="text" name="ceptel" style="width: 250px; height: 25px" /></td>
</tr>
</table>
</form>
<form action="" method="post">
<h3>Yayın Bilgileri</h3>
<table>
<tr>
<td width="108">Yayın Türü</td>
<td width="280"><select name="liste">
<option value="kitap">Kitap</option>
<option value="dergi">Dergi</option>
<option value="seskasedi">Ses Kasedi</option>
<option value="videokasedi">Video Kasedi</option>
<option value="vcd">VCD</option>
<option value="dvd">DVD</option>
<option value="cd">CD</option>
<option value="disket">Disket</option>
</select>
<input type="text" name="digeryayin" value="Diğer (Belirtiniz)" style="width: 250px; height: 25px; margin-top: 5px" />
</td>
</tr>
<tr>
<td>Yayın Adı</td>
<td><input type="text" name="yayinadi" style="width: 250px; height: 25px" /></td>
</tr>
<tr>
<td>Yazar Adı & Soyadı</td>
<td><input type="text" name="yazaradi" style="width: 250px; height: 25px" /></td>
</tr>
<tr>
<td>Yayınevi</td>
<td><input type="email" name="yayinevi" style="width: 250px; height: 25px" /></td>
</tr>
<tr>
<td>ISBN-ISSN</td>
<td><input type="text" name="isbn" style="width: 250px; height: 25px" /></td>
</tr>
<tr>
<td>Yayını Nerede Gördünüz?</td>
<td><textarea name="gorulme" cols="42" rows="4"></textarea></td>
</tr>
<tr>
<td></td>
<td><button type="submit">Gönder</button></td>
</tr>
</table>
</form>
</body>
</html>
Cevabınız için çok teşekkürler. Dediğiniz yöntemi denemiştim. Fakat mail bomboş geliyor bana.
--R10.NET; Flood Engellendi -->-> Yeni yazılan mesaj 12:26:05 -->-> Daha önceki mesaj 12:10:55 --
Edit: Çok ilginçtir ki sadece şu kısım doldurulduğunda mail adresime de geliyor o bilgi:
Alıntı
<tr>
<td>Yayını Nerede Gördünüz?</td>
<td><textarea name="gorulme" cols="42" rows="4"></textarea></td>
</tr>
Diğer bilgiler gelmiyor. Diğer kısımları da buna benzer yaptım fakat işe yaramadı.