bu linkteki formmaili indirip kurdum çalıştırdım sorunsuz çalışıyor.
Fakat Bunda
İSİM - EMAİL- DOSYA - KONU - MESAJ verilerini girip gönderilebiliyor.
BENİM YAPMAK İSTEDİĞİM.
Telefon - Fax alan yerlerini yaptım fakat gönder dediğimde telefon ve fax verileri gelmiyor.
DOSYAMDAKİ KODLARI <?php
require('phpmailer/class.phpmailer.php');
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->SMTPDebug = 0;
$mail->SMTPAuth = TRUE;
$mail->SMTPSecure = "tls";
$mail->Port = 587;
$mail->Username = "mail adı";
$mail->Password = "mail şifre";
$mail->Host = "mail host";
$mail->Mailer = "smtp";
$mail->SetFrom($_POST["userEmail"], $_POST["userName"]);
$mail->AddReplyTo($_POST["userEmail"], $_POST["userName"]);
$mail->AddReplyTo($_POST["tel"], $_POST["tel"]);
$mail->AddReplyTo($_POST["fax"], $_POST["fax"]);
$mail->AddAddress("gidecek mail adresi");
$mail->Subject = $_POST["subject"];
$mail->WordWrap = 80;
$mail->MsgHTML($_POST["content"]);
if(is_array($_FILES)) {
$mail->AddAttachment($_FILES['attachmentFile']['tmp_name'],$_FILES['attachmentFile']['name']);
}
$mail->IsHTML(true);
if(!$mail->Send()) {
echo "<p class='error'>Problem in Sending Mail.</p>";
} else {
echo "<p class='success'>Contact Mail Sent.</p>";
}
?> <?php
require('phpmailer/class.phpmailer.php');
$mesaj='
İsim : $ad
Tel : $tel
Fax : $fax
'
;
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->SMTPDebug = 0;
$mail->SMTPAuth = TRUE;
$mail->SMTPSecure = "tls";
$mail->Port = 587;
$mail->Username = "mail adı";
$mail->Password = "mail şifre";
$mail->Host = "mail host";
$mail->Mailer = "smtp";
$mail->SetFrom($_POST["userEmail"], $_POST["userName"]);
$mail->AddReplyTo($_POST["userEmail"], $_POST["userName"]);
$mail->AddAddress("gidecek mail adresi");
$mail->Subject = $_POST["subject"];
$mail->WordWrap = 80;
$mail->MsgHTML($mesaj);
if(is_array($_FILES)) {
$mail->AddAttachment($_FILES['attachmentFile']['tmp_name'],$_FILES['attachmentFile']['name']);
}
$mail->IsHTML(true);
if(!$mail->Send()) {
echo "<p class='error'>Problem in Sending Mail.</p>";
} else {
echo "<p class='success'>Contact Mail Sent.</p>";
}
?>Bu şekilde olmalı. Sen olayı çok yanlış anlamışsın.
AddReplyTo değeri mailde gönderilecek mail adresi demektir.
Oraya isim ve mail değeri harici hiç bir veri giremessin.
Benim yaptığım gibi mesaj değişkeni oluştur içerisine tüm verileri gir.
En son mesaj değişkenini gönder.