Jump to content

Form Mail Problem


oceanfear

Recommended Posts

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
Share on other sites

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 = "uday@ultiviz.com";

          $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
Share on other sites

  • 2 weeks later...

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.