xneverever Posted August 24, 2013 Share Posted August 24, 2013 natro nun php mail örneği, mail gönderebiliyorum. sorun ise php maile dosya ekleyemiyorum acamiyim :( form.htm ye bunu ekliyorum <input name="gidicekdosya" type="file"> mail.php ye nasıl bir ekleme yapıcam yardımcı olabilir misiniz? http://www.natro.com/HemenDestek/Downloads/mailphp.zip mail.php <? require("class.phpmailer.php"); $mail = new PHPMailer(); $mail->IsSMTP(); // send via SMTP $mail->Host = "mail.aaa.net"; // SMTP servers $mail->SMTPAuth = true; // turn on SMTP authentication $mail->Username = "[email protected]"; // SMTP username $mail->Password = "aaa"; // SMTP password $mail->From = "[email protected]"; // smtp kullanıcı adınız ile aynı olmalı $mail->Fromname = "site"; $mail->AddAddress("[email protected]","Ornek Isim"); $mail->Subject = $_POST['baslik']; $mail->Body = implode(" ",$_POST); if(!$mail->Send()) { echo "Mesaj Gönderilemedi <p>"; echo "Mailer Error: " . $mail->ErrorInfo; exit; } echo "Mesaj Gönderildi"; ?> Quote Link to comment Share on other sites More sharing options...
xneverever Posted August 26, 2013 Author Share Posted August 26, 2013 php bilen yok mu :( Quote Link to comment Share on other sites More sharing options...
reyiz Posted August 31, 2013 Share Posted August 31, 2013 (edited) ... Edited November 8, 2013 by reyiz Quote Link to comment Share on other sites More sharing options...
xneverever Posted September 1, 2013 Author Share Posted September 1, 2013 form.htm dosyasını paylaşabilir misin? Sorun yoksa PHP kodlarını inceleyeceğim. form.htm <html> <head> <meta http-equiv="Content-Language" content="tr"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1254"> <title>New Page 1</title> </head> <body> <form method="POST" action="mail.php" method="post" enctype="multipart/form-data"> <p><font color="#FF0000"><b>Adınız Soyadınız: <input type="text" name="isim" size="20"></b></font></p> <p><font color="#FF0000"><b>E-mail Adresiniz: <input type="text" name="mailad" size="20"></b></font></p> <blockquote> <p><font color="#FF0000"><b>Konu : </b></font> <input type="text" name="baslik" size="20"></p> </blockquote> <p><b><font color="#FF0000">Mesajınız : <textarea rows="6" name="mesaj" cols="30"></textarea></font></b></p> <input name="gidicekdosya" type="file"> <p><input type="submit" value="Gönder"></p> </form> </body> </html> php kodu sadece mail atıyor dosya ile birlikte gitmesi için attachment kodu eklenmesi lazım diye biliyorum ama nasıl eklenecek onu bilmemekteyim. Quote Link to comment Share on other sites More sharing options...
galetis Posted September 1, 2013 Share Posted September 1, 2013 $fileName = $_FILES['gidicekdosya']['name']; $filePath = $_FILES['gidicekdosya']['tmpname']; $mail->AddAttachment($filePath, $fileName); Quote Link to comment Share on other sites More sharing options...
xneverever Posted September 1, 2013 Author Share Posted September 1, 2013 (edited) yok usta dosya gitmiyor yine mesaj gidiyor ama <? require("class.phpmailer.php"); $mail = new PHPMailer(); $mail->IsSMTP(); // send via SMTP $mail->Host = "mail.aaa.com"; // SMTP servers $mail->SMTPAuth = true; // turn on SMTP authentication $mail->Username = "[email protected]"; // SMTP username $mail->Password = "aaaaaa"; // SMTP password $mail->From = "[email protected]"; // smtp kullanıcı adınız ile aynı olmalı $mail->Fromname = "giden ismi"; $mail->AddAddress("[email protected]","Ornek Isim"); $mail->Subject = $_POST['baslik']; $fileName = $_FILES['gidicekdosya']['name']; $filePath = $_FILES['gidicekdosya']['tmpname']; $mail->AddAttachment($filePath, $fileName); $mail->Body = implode(" ",$_POST); if(!$mail->Send()) { echo "Mesaj Gönderilemedi <p>"; echo "Mailer Error: " . $mail->ErrorInfo; exit; } echo "Mesaj Gönderildi"; ?> Edited September 1, 2013 by xneverever Quote Link to comment Share on other sites More sharing options...
galetis Posted September 1, 2013 Share Posted September 1, 2013 kodu iften önce ekliyeceksin Quote Link to comment Share on other sites More sharing options...
xneverever Posted September 1, 2013 Author Share Posted September 1, 2013 kodu iften önce ekliyeceksin verdiğin kod iften önce şuan, büyük ihtimal upload yaptıktan sonra mail atacak olabilir mi? upload yapmadan göndermiyor olabilir. Quote Link to comment Share on other sites More sharing options...
xneverever Posted September 1, 2013 Author Share Posted September 1, 2013 evet dediğim gibiymiş upload yaparak göndermeyi başardım yardımların için sağol galetis. :punk: :punk: :punk: Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.