oceanfear Posted June 5, 2007 Share Posted June 5, 2007 I have a problem with my email form. It works fine but now seems to have problem. I couldnt fix it, any idea? Iam sending the code. İletişim.php <form name="form1" method="POST" action="mailsend"> <table width="100%" border="0" cellspacing="0" cellpadding="2"> <tr> <td colspan="2" bgcolor="#FFFFFF" class="style5"><strong>Mail Formu<strong></td> </tr> <tr> <td width="26%" bgcolor="#FFFFFF" class="style5">Adýnýz Soyadýnýz </td> <td width="74%" bgcolor="#FFFFFF" class="style5"><input name="ad" type="text" id="ad" size="40"></td> </tr> <tr> <td bgcolor="#FFFFFF" class="style5">Mail Adresiniz </td> <td bgcolor="#FFFFFF" class="style5"><input name="email" type="text" id="email" size="40"></td> </tr> <tr> <td bgcolor="#FFFFFF" class="style5">Telefon Numaranýz </td> <td bgcolor="#FFFFFF" class="style5"><input name="tel" type="text" id="tel" size="40"></td> </tr> <tr> <td bgcolor="#FFFFFF" class="style5">Mesajýnýz</td> <td bgcolor="#FFFFFF" class="style5"><textarea name="mesaj" cols="40" rows="5" id="mesaj"></textarea></td> </tr> <tr> <td colspan="2" bgcolor="#FFFFFF" class="style5"><div align="center"> <input type="submit" name="Submit" value="Formu Gönder"> Send.php $mail_text="<html> <head> <title>Mail</title> <meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-9\"> <meta http-equiv=\"Content-Type\" content=\"text/html; charset=windows-1254\"> <style type=\"text/css\"> <!-- td { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px} --> </style> </head> <body bgcolor=\"#FFFFFF\" text=\"#999999\" leftmargin=\"0\" topmargin=\"0\"> <table border=\"1\" cellpadding=\"0\" cellspacing=\"0\" width=\"443 bordercolorligth=\"#000000\" bordercolordark=\"#FFFFFF\"\"> <tr> <td colspan=2 height=\"18\" bgcolor=\"#EBEBEB\"> <b>Iletisim Formu</b></td> </tr> <tr> <td height=\"28\"><b> Adi - Soyadi</b></td> <td width=\"285\" height=\"28\"><b>$ad</b></td> </tr> <tr> <td height=\"25\"><b>Telefon Numarasý</b></td> <td width=\"285\" height=\"25\"><b>$tel</b></td> </tr> <tr> <td height=\"25\" valign=\"top\"><b>E-Mail Adresi</b></td> <td width=\"285\" height=\"25\"><b>$email</b></td> </tr> <tr> <td height=\"25\" valign=\"top\"><b>Mesaj</b></td> <td width=\"285\" height=\"25\"><b>$$mesaj </b></td> </tr> </table> </body> </html>"; $headers = "From: ............... <.......@...............>\n"; $headers .= "Return-Path: <......@..........>\n"; $headers .= "Content-Type: text/html\n"; $recipient="........@.............."; $konu="...................... - $ad"; $sonuc = @mail($recipient, $konu, $mail_text, $headers); if ($sonuc) { echo "Mail formunuz gönderildi. Tesekkür ederiz. <br><br>"; } else { echo "Mail Formunuz gönderilemedi. Lütfen bir önceki sayfadan tekrar deneyiniz. <br><br> <a href=\"javascript:history.go(-1);\">«geri dönmek için tiklayiniz.</a>"; } ?> </td> </tr> And in install.php case "mailsend" : include "send.php";break; Link to comment https://forums.phpfreaks.com/topic/54275-form-mail-problem/ Share on other sites More sharing options...
dream25 Posted June 5, 2007 Share Posted June 5, 2007 Better u try this one... if u go thro this code.. then u find what prob in ur code.. got it <?php require("phpmailer/class.phpmailer.php"); if(isset($_POST['submit'])) { echo "Your Name Is <br>" . $_POST['txtname'] ; $link = mysql_connect("localhost","root",""); if(!$link) echo "Database Connection Failed" . mysql_error(); $db = mysql_select_db("test") ; $name = $_POST['txtname']; $email = $_POST['txtemail']; $sql = "insert into contact_us values('','".$_POST['txtname']."','".$_POST['txtemail']."')" ; $res = mysql_query($sql); if($res) { $mail = new PHPMailer(); $mail->IsSMTP(); // telling the class to use SMTP $mail->Host = "localhost"; // SMTP server $mail->From = "[email protected]"; $mail->AddAddress($email); $mail->Subject = "first mailing"; $mail->Body = "hi ! \n\n this is First mailing I made myself with PHPMailer !"; $mail->WordWrap = 50; if(!$mail->Send()) { echo "Message was not sent"; echo "Mailer Error: " . $mail->ErrorInfo; } else { echo "Message has been sent"; } } } ?> <html> <head> <title>Enter Data</title> </head> <body> <form name="theform" action="test.php" method="post" action="sendmail.php"> <table> <tr> <td>Name :</td> <td><input type="text" name="txtname" size="50"></td> </tr> <tr> <td>Email :</td> <td> <input type="text" name="txtemail" size="50"> </td> </tr> <tr> <td></td> <td> <input type="submit" name="submit" value="Submit"> <input type="reset" value="Reset"> </td> </tr> </table> </form> </body> </html> Link to comment https://forums.phpfreaks.com/topic/54275-form-mail-problem/#findComment-268341 Share on other sites More sharing options...
oceanfear Posted June 14, 2007 Author Share Posted June 14, 2007 I used the code you wrote, but nothing changes. The adress line changes like this .............index.php?searchfor=Arama&txtname=&txtemail=&submit=Submit (also same in my code) I think it isnt becouse of the code, it is becouse of the page, I have a diffrent problem I thougt? But what? Link to comment https://forums.phpfreaks.com/topic/54275-form-mail-problem/#findComment-274555 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.