Jump to content

email form


sonyaseth

Recommended Posts

dear friends ,

 

i have this html page

"</head>

 

<body>

 

                  <table width="93%" border="0" align="center" cellpadding="2" cellspacing="4">

                    <tr>

                      <td height="35" colspan="3" valign="top" class="heading" style="padding-top:8px; color:#448B9A; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; font-weight:bold;"><strong>Contact Us :</strong></td>

                    </tr>

                    <tr>

                      <td width="36%" class="body">Your Name:</td>

                      <td width="64%" colspan="2">

                      <input type="text" name="textfield3" style="width:250px; height:13px;" size="20" /></td>

                    </tr>

                    <tr>

                      <td class="body">Address:</td>

                      <td colspan="2">

                      <input type="text" name="textfield32" style="width:250px; height:13px;" size="20" /></td>

                    </tr>

                    <tr>

                      <td class="body">City:</td>

                      <td colspan="2">

                      <input type="text" name="textfield33" style="width:250px; height:13px;" size="20" /></td>

                    </tr>

                    <tr>

                      <td class="body"> Country:</td>

                      <td colspan="2">

                      <input type="text" name="textfield34" style="width:250px; height:13px;" size="20" /></td>

                    </tr>

                    <tr>

                      <td class="body">Phone no:</td>

                      <td colspan="2">

                      <input type="text" name="textfield35" style="width:250px; height:13px;" size="20" /></td>

                    </tr>

                    <tr>

                      <td class="body">email Address:</td>

                      <td colspan="2">

                      <input type="text" name="textfield36" style="width:250px; height:13px;" size="20" /></td>

                    </tr>

                    <tr>

                      <td class="body">Comments:</td>

                      <td colspan="2"><textarea name="textarea" rows="5" cols="" style="width:250px;"></textarea></td>

                    </tr>

                    <tr>

                      <td> </td>

                      <td colspan="2"><table width="100%" border="0" cellspacing="0" cellpadding="0">

                          <tr>

                            <td width="28%">

                            <input type="image" name="imageField2" src="/images/submit.gif" width="62" height="22" /></td>

                            <td width="72%">

                            <input type="image" name="imageField3" src="/images/reset.gif" width="62" height="22" /></td>

                          </tr>

                      </table></td>

                    </tr>

                  </table>

                               

</body>

 

</html>

"

 

how i can use this to send email to my email address  John@gmail.com thru site when someone submit the form

 

[attachment deleted by admin]

Link to comment
Share on other sites

thnks for yr reply,

 

but the problem is that is a email form inside a webpage where when some fill his details  and hit submit  i recv a email in my account which is configure in script  for this i have to put php configuration file in post or action of my page code  "http://www.solucioneshttp.com.ar/Portfolio/regalos_joyas/YT-JW0103/html/contact.html" this is a example page of this email form i think have to mange a change in " <td><form id="form1" name="form1" method="post" action="">  and then put a  in relation with php file

 

Link to comment
Share on other sites

First of all, change the names of those text fields, try to give them names as per their lable. for ex.. Your Name would be <input type="text" style="width:250px; height:13px;" name="name"> insteand of <input type="text" style="width:250px; height:13px;" name="textfield3">

 

when you are done, make your from look like this <form action="mail.php" method="post" enctype="multipart/form-data" name="form1" target=""  id="from1">

 

crate a new php file on your server and name it mail.php and paste the below code there:

 

<?php
///make sure you name your input fields in your html page same as the names inside $_POST[''] below.
$name = $_POST['name'];
$address = $_POST['address'];
$city = $_POST['city'];
$country = $_POST['country'];
$phone_number = $_POST['phone'];
$email = $_POST['email'];
$comments = $_POST['comments'];

 include("data/mailer.class.php");
$mailer=new mailer("yourname@gmail.com","New Job Application",$msge,"From: webmaster@localhost");
//$mailer->file("".$file1);
$mailer->attach("text/plain","see.txt","encruption format 3g ready xx344axOO3cc");
$test=$mailer->send();
echo $test?"sent":"error";
?>

 

now download the mailer.class.php from the attachment and place it next to mail.php on your server.

 

you should now be able to send the mail.

 

[attachment deleted by admin]

Link to comment
Share on other sites

  i have used this and it works fine  but not fully " Only two thing are to be resolved to make it correct or better "

 

 

1- In gmail box  i recv  only a email showing "encruption format 3g ready xx344axOO3cc " and nothing else "that was filled  by the user in form"

 

2-Other is that after hitting the submit button or after sending email it shows text '"sent " and redirect to mail.php ---- instead of it it will be more sweet if it redirect to home page or index.htm while a confirmation of sent or thnking u in pop popup  or in box

 

Link to comment
Share on other sites

Sorry i forgot to create a variable,  just add this line of code bellow $comments.

$msge = "Senders Name : ".$name."<br> Senders Address : ". $address."<br> Senders City : " .$city."<br> Senders Country : ".$country."<br> Senders Phone Number : ".$phone_number."<br> Senders Email : ".$email."<br> Senders Comments : ".$comments; 

 

Hope that will help.

Link to comment
Share on other sites

If you want redirect, use this code:

 

<html>
<head>
<script type="text/javascript">
<!--
function delayer(){
    window.location = "../javascriptredirect.php"
}
//-->
</script>
<?php
///make sure you name your input fields in your html page same as the names inside $_POST[''] below.
$name = $_POST['name'];
$address = $_POST['address'];
$city = $_POST['city'];
$country = $_POST['country'];
$phone_number = $_POST['phone'];
$email = $_POST['email'];
$comments = $_POST['comments'];

$msge = "Senders Name : ".$name."<br> Senders Address : ". $address."<br> Senders City : " .$city."<br> Senders Country : ".$country."<br> Senders Phone Number : ".$phone_number."<br> Senders Email : ".$email."<br> Senders Comments : ".$comments; 

 include("data/mailer.class.php");
$mailer=new mailer("yourname@gmail.com","New Job Application",$msge,"From: webmaster@localhost");
//$mailer->file("".$file1);
$mailer->attach("text/plain","see.txt","encruption format 3g ready xx344axOO3cc");
$test=$mailer->send();
echo $test? ?> </head>
<body onLoad="setTimeout('delayer()', 5000)">
<h2>Your Mail has been sent !</h2>
<p>You are being redirected in a few movements, please wait..... </p>

</body>
</html><?php :"error";
?>

i have not tested the redirect code, let me know if there is a problem.

Link to comment
Share on other sites

Thnks

 

First issure is solved almost i recvd whatever user has filled in email form on site

 

now reidrect issue you have mention "window.location = "../javascriptredirect.php"

 

where is the javascriptredirect.php file  do i have to change what modification to redirect to index.htm file or home page

thnks for earlier reply if this problem also solved then i can upload it on site and work futher on it may b http://blogulate.com/content/php-function-for-javascript-redirect/ will give u better clue to redirect

Link to comment
Share on other sites

while redirection in form mail thru this "

<html>

<head>

<script type="text/javascript">

<!--

function delayer(){

    window.location = "/index.htm"

}

//-->

</script>

<?php

///make sure you name your input fields in your html page same as the names inside $_POST[''] below.

$name = $_POST['name'];

$address = $_POST['address'];

$city = $_POST['city'];

$country = $_POST['country'];

$phone_number = $_POST['phone'];

$email = $_POST['email'];

$comments = $_POST['comments'];

$msge = "Senders Name : ".$name."<br> Senders Address : ". $address."<br> Senders City : " .$city."<br> Senders Country : ".$country."<br> Senders Phone Number : ".$phone_number."<br> Senders Email : ".$email."<br> Senders Comments : ".$comments;

 

include("data/mailer.class.php");

$mailer=new mailer("yourname@gmail.com","New Job Application",$msge,"From: webmaster@localhost");

//$mailer->file("".$file1);

$mailer->attach("text/plain","see.txt","encruption format 3g ready xx344axOO3cc");

$test=$mailer->send();

echo $test? ?> </head>

<body onLoad="setTimeout('delayer()', 5000)">

<h2>Your Mail has been sent !</h2>

<p>You are being redirected in a few movements, please wait..... </p>

 

</body>

</html><?php :"error";

?>

 

  i m having this error

 

Parse error: syntax error, unexpected ';' in/public_html/mail.php on line 26

bu with oringal code without redirectin is working fine

 

 

"<?php

///make sure you name your input fields in your html page same as the names inside $_POST[''] below.

$name = $_POST['name'];

$address = $_POST['address'];

$city = $_POST['city'];

$country = $_POST['country'];

$phone_number = $_POST['phone'];

$email = $_POST['email'];

$comments = $_POST['comments'];

$msge = "Senders Name : ".$name."<br> Senders Address : ". $address."<br> Senders City : " .$city."<br> Senders Country : ".$country."<br> Senders Phone Number : ".$phone_number."<br> Senders Email : ".$email."<br> Senders Comments : ".$comments;

 

include("data/mailer.class.php");

$mailer=new mailer("yourname@gmail.com","New Job Application",$msge,"From: webmaster@localhost");

//$mailer->file("".$file1);

$mailer->attach("text/plain","see.txt","encruption format 3g ready xx344axOO3cc");

$test=$mailer->send();

echo $test?"sent":"error";

?>

  how to redirect

Link to comment
Share on other sites

code

"<html>

<head>

<script type="text/javascript">

<!--

function delayer(){

    window.location = "/index.htm"

}

//-->

</script>

<?php

///make sure you name your input fields in your html page same as the names inside $_POST[''] below.

$name = $_POST['name'];

$address = $_POST['address'];

$city = $_POST['city'];

$country = $_POST['country'];

$phone_number = $_POST['phone'];

$email = $_POST['email'];

$comments = $_POST['comments'];

$msge = "Senders Name : ".$name."<br> Senders Address : ". $address."<br> Senders City : " .$city."<br> Senders Country : ".$country."<br> Senders Phone Number : ".$phone_number."<br> Senders Email : ".$email."<br> Senders Comments : ".$comments;

 

    include("data/mailer.class.php");

$mailer=new mailer("yourname@gmail.com","New Job Application",$msge,"From: webmaster@localhost");

//$mailer->file("".$file1);

$mailer->attach("text/plain","see.txt","encruption format 3g ready xx344axOO3cc");

$test=$mailer->send();

echo $test? ?> </head>

<body onLoad="setTimeout('delayer()', 5000)">

<h2>Your Mail has been sent !</h2>

<p>You are being redirected in a few movements, please wait..... </p>

 

</body>

</html><?php :"error";

?>"

 

ERROR "Parse error: syntax error, unexpected ';' in /mail.php on line 26

 

 

But oringal code for which i am thnkful  :hail_freaks:withour redirection working fine which is also given blow

 

"<?php

///make sure you name your input fields in your html page same as the names inside $_POST[''] below.

$name = $_POST['name'];

$address = $_POST['address'];

$city = $_POST['city'];

$country = $_POST['country'];

$phone_number = $_POST['phone'];

$email = $_POST['email'];

$comments = $_POST['comments'];

$msge = "Senders Name : ".$name."<br> Senders Address : ". $address."<br> Senders City : " .$city."<br> Senders Country : ".$country."<br> Senders Phone Number : ".$phone_number."<br> Senders Email : ".$email."<br> Senders Comments : ".$comments;

 

    include("data/mailer.class.php");

$mailer=new mailer("yourname@gmail.com","New Job Application",$msge,"From: webmaster@localhost");

//$mailer->file("".$file1);

$mailer->attach("text/plain","see.txt","encruption format 3g ready xx344axOO3cc");

$test=$mailer->send();

echo $test?"sent":"error";

?>

Link to comment
Share on other sites

where is the error i m still unable to sort out

to me the error is some whre in this sectionmetnioned below

 


/$mailer->file("".$file1);
$mailer->attach("text/plain","see.txt","encruption format 3g ready xx344axOO3cc");
$test=$mailer->send();
echo $test? ?> </head>
<body onLoad="setTimeout('delayer()', 5000)">
<h2>Your Mail has been sent !</h2>
<p>You are being redirected in a few movements, please wait..... </p>

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.