954,123 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Dreamweaver email forms

Im using dreamweaver. I want to have a "email us" page.

The person puts in there name,email..etc and it sends it to my mail box.

How do i do this? do i need to used a dynamic page?

Dreamweaver comes with email templates so or i have to do is fill the code in.
But i dont know what that is.

If anyones can help, please do.

thanks
please email me: [email]everchange10@yahoo.co.uk[/email]

poes
Newbie Poster
3 posts since Jul 2005
Reputation Points: 10
Solved Threads: 0
 

The basic Email form can probably be pulled from template example from DW like you mentioned, if not there are lots of examples on the web just google it. The portion you will have to cutomize is the form method and this depends on what scripting language you use and what your server supports again there are lots of examples o the web. One of the most popular is the php method.

bkendall
Junior Poster in Training
69 posts since Jul 2005
Reputation Points: 10
Solved Threads: 0
 

When i create my site does it have to be a dynamic page?

I just have a normal html homepage.It has a few buttons, one of the 'contact' . i want people to fill in there email name,etc and send it to me via a "send" button.

Can anyone help

Thanks

poes
Newbie Poster
3 posts since Jul 2005
Reputation Points: 10
Solved Threads: 0
 

your form page will be just like any other page except that it will have form tags

<form name="form1" id="form1" method="post" action="">
  Field Name: 
  <input name="field name" type="text" id="field name" />
</form>


the action=''''> is where you would need to use a langauge such as php which might look like this:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
	"http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<title>Contact Form</title>
<meta http-equiv="Content-Type" 
   content="text/html; charset=iso-8859-1">
</head>
<body>
<?php
   if ($_SERVER['REQUEST_METHOD'] != 'POST'){
      $me = $_SERVER['PHP_SELF'];
?>
   <form name="form1" method="post"
         action="<?php echo $me;?>">
      <table border="0" cellspacing="0" cellpadding="2">
         <tr>
            <td>Name:</td>
            <td><input type="text" name="Name"></td>
         </tr>
         <tr>
            <td>Subject</td>
            <td><input type="text" name="Subject"></td>
         </tr>
         <tr>
            <td valign="top">Message:</td>
            <td><textarea name="MsgBody"></textarea></td>
         </tr>
         <tr>
            <td>&nbsp;</td>
            <td><input type="submit" name="Submit"
               value="Send"></td>
         </tr>
      </table>
   </form>
<?php
   } else {
      error_reporting(0);
      $recipient = 'me@myaddress.com';
      $subject = stripslashes($_POST['Subject']);
      $from = stripslashes($_POST['Name']);
      $msg = "Message from: $from\n\n".stripslashes($_POST['MsgBody']);
      if (mail($recipient, $subject, $msg))
         echo nl2br("<b>Message Sent:</b>
         To: $recipient
         Subject: $subject
         Message:
         $msg");
      else
         echo "Message failed to send";
}
?>
</body>
</html>


You will need to check if you have access to a php server if not there are other methods that you can use. If all else fails you can send it via javascript, which is a dirty way to do it but will work.

bkendall
Junior Poster in Training
69 posts since Jul 2005
Reputation Points: 10
Solved Threads: 0
 

thanks alot

I just found out that my server doesnt support php. I'm learning alot (it was cheap and now i know why)

so the next best way?

cheers

poes
Newbie Poster
3 posts since Jul 2005
Reputation Points: 10
Solved Threads: 0
 

you should find out what they do support
asp
coldfusion
JSP
CGI

then I can try and walk you through how to use what you have available

bkendall
Junior Poster in Training
69 posts since Jul 2005
Reputation Points: 10
Solved Threads: 0
 

you can more easily make an email form by simply typing the the action box of the form mailto:youremail@yourserver.com and in the enctyp feild text/plain but this can be an unreliable way and requires users to have an email client setup on their computer and working and if it fails it may fail invisibly. for more info go to http://www.macromedia.com/go/tn_14853

paintbalforjesu
Newbie Poster
1 post since Aug 2005
Reputation Points: 10
Solved Threads: 0
 

I have some free ones that you could use email forms using flash or take as anexample and make your own.

bobbyjones
Newbie Poster
1 post since Aug 2005
Reputation Points: 10
Solved Threads: 0
 
I have some free ones that you could use email forms using flash or take as anexample and make your own.

Those are cool, there is also a link on that site to some cool ones with attachment capability at http://www.flashattach.com Really cool!

xeno439
Light Poster
29 posts since Jul 2005
Reputation Points: 10
Solved Threads: 0
 

I had exactly the same problem. I used JMAIL with mine. this resolved the problem. This is where i got an example code: http://www.webwizguide.info/asp/tutorials/email_using_jmail_tutorial.asp . If i were you, go ahead and download the sample forms from here: http://download.webwizguide.info/asp_tutorials/JMail_web_based_email_tutorial_v1.0.zip . they contain 4 email samples and is very good for making jmail forms. Its fairly easy to pick up. The script will need you to put in your smtp server. This is a link which contains a link of many smtp servers: http://www.more-solutions.co.uk/support/email-smtp.html .

So there u go :cheesy:

good luck. If u need any more info, give me a bell (just remember, im not pro myself, but i recently had the same problem :P)

MaxMumford
Posting Whiz in Training
228 posts since Oct 2006
Reputation Points: 32
Solved Threads: 3
 

your form page will be just like any other page except that it will have form tags

<form name="form1" id="form1" method="post" action="">
  Field Name: 
  <input name="field name" type="text" id="field name" />
</form>

the action=''''> is where you would need to use a langauge such as php which might look like this:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
	"http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<title>Contact Form</title>
<meta http-equiv="Content-Type" 
   content="text/html; charset=iso-8859-1">
</head>
<body>
<?php
   if ($_SERVER['REQUEST_METHOD'] != 'POST'){
      $me = $_SERVER['PHP_SELF'];
?>
   <form name="form1" method="post"
         action="<?php echo $me;?>">
      <table border="0" cellspacing="0" cellpadding="2">
         <tr>
            <td>Name:</td>
            <td><input type="text" name="Name"></td>
         </tr>
         <tr>
            <td>Subject</td>
            <td><input type="text" name="Subject"></td>
         </tr>
         <tr>
            <td valign="top">Message:</td>
            <td><textarea name="MsgBody"></textarea></td>
         </tr>
         <tr>
            <td>&nbsp;</td>
            <td><input type="submit" name="Submit"
               value="Send"></td>
         </tr>
      </table>
   </form>
<?php
   } else {
      error_reporting(0);
      $recipient = 'me@myaddress.com';
      $subject = stripslashes($_POST['Subject']);
      $from = stripslashes($_POST['Name']);
      $msg = "Message from: $from\n\n".stripslashes($_POST['MsgBody']);
      if (mail($recipient, $subject, $msg))
         echo nl2br("<b>Message Sent:</b>
         To: $recipient
         Subject: $subject
         Message:
         $msg");
      else
         echo "Message failed to send";
}
?>
</body>
</html>

You will need to check if you have access to a php server if not there are other methods that you can use. If all else fails you can send it via javascript, which is a dirty way to do it but will work.


This was the best help. In a matter of a few minutes I had this email form up and running inside a table on my site. Thanks!

I do have a ? though. Is it possible to somehow encrypt or 'hide' the email address that receives the form? (So it does not get crawled and spammed)


Thanks again!

TrailBlazer
Newbie Poster
4 posts since Feb 2007
Reputation Points: 10
Solved Threads: 0
 

your form page will be just like any other page except that it will have form tags

<form name="form1" id="form1" method="post" action="">
  Field Name: 
  <input name="field name" type="text" id="field name" />
</form>

the action=''''> is where you would need to use a langauge such as php which might look like this:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
    "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<title>Contact Form</title>
<meta http-equiv="Content-Type" 
   content="text/html; charset=iso-8859-1">
</head>
<body>
<?php
   if ($_SERVER['REQUEST_METHOD'] != 'POST'){
      $me = $_SERVER['PHP_SELF'];
?>
   <form name="form1" method="post"
         action="<?php echo $me;?>">
      <table border="0" cellspacing="0" cellpadding="2">
         <tr>
            <td>Name:</td>
            <td><input type="text" name="Name"></td>
         </tr>
         <tr>
            <td>Subject</td>
            <td><input type="text" name="Subject"></td>
         </tr>
         <tr>
            <td valign="top">Message:</td>
            <td><textarea name="MsgBody"></textarea></td>
         </tr>
         <tr>
            <td>&nbsp;</td>
            <td><input type="submit" name="Submit"
               value="Send"></td>
         </tr>
      </table>
   </form>
<?php
   } else {
      error_reporting(0);
      $recipient = 'me@myaddress.com';
      $subject = stripslashes($_POST['Subject']);
      $from = stripslashes($_POST['Name']);
      $msg = "Message from: $from\n\n".stripslashes($_POST['MsgBody']);
      if (mail($recipient, $subject, $msg))
         echo nl2br("<b>Message Sent:</b>
         To: $recipient
         Subject: $subject
         Message:
         $msg");
      else
         echo "Message failed to send";
}
?>
</body>
</html>

You will need to check if you have access to a php server if not there are other methods that you can use. If all else fails you can send it via javascript, which is a dirty way to do it but will work.



How would i go about adjusting the end section of script if i have put in an email address text box in the form.

Regards
Ashjenius

Ashjenius
Newbie Poster
6 posts since Feb 2007
Reputation Points: 10
Solved Threads: 0
 

expandboxtop.gif
sslogonew.gif nav1.jpgnav2.jpgnav3.jpgnav4.jpgnav5.jpgnav6.jpgnav7.jpg     spacerbotmarg.gif   spacerbotmarg.gifspacerbotmarg.gif   spacerbotmarg.gif        

contactinfo.gif
about us.org

<?php if ($_SERVER['REQUEST_METHOD'] != 'POST'){ $me = $_SERVER['PHP_SELF']; ?> Name: Subject: Message:   <?php } else { error_reporting(0); $recipient = 'fake@fakeemail.com'; $subject = stripslashes($_POST['Subject']); $from = stripslashes($_POST['Name']); $msg = "Message from: $from\n\n".stripslashes($_POST['MsgBody']); if (mail($recipient, $subject, $msg)) echo nl2br("Message Sent: To: $recipient Subject: $subject Message: $msg"); else echo "Message failed to send"; } ?>  

expandboxfly7bott.gif Copyright © 2006 Sandy Sanders

TrailBlazer
Newbie Poster
4 posts since Feb 2007
Reputation Points: 10
Solved Threads: 0
 

Great stuff, thanks!

- Vince

vincearcuri
Newbie Poster
1 post since Aug 2008
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You