Can someone please help me. I just want to put a simple form on my web site. I am using dreamweaver and first of all, I am NOT a techy. I basically taught myself Dreamweaver and created my own e-commerce site. I would like to have a form for people to sign up for a newsletter. All I want them to fill in is NAME and EMAIL ADDRESS. I paid someone to build be a Contact Us Page. I just cant believe it is that hard to do. I just feel like there is one step that I am missing. I am pretty computer literate but I am not a programmer. I would appreciate any help you can give me. I am sure someone has a simple basic form out there that they would share. Thanks.

Recommended Answers

All 8 Replies

What exactly do you want the form to do?

Would you like it to just send you an email with their name and email? If so, this is an easy PHP project. :cheesy:

Yes, all I want the form to do is to send me an email with their name and email address.

Try this:

On your form, have the field for their name called "name".
The field for their email should be called "email".

Now, below is the PHP code for the page you submit the form to.

$subject = "New Mailing List Signup";
$sendto = "your@email.addy";
$body = "This is the information filled out for their signup. /n /n Name: $name /n Email: $email /n /n This signup was generated by your server."

You can customize it however you want. And for your understanding, the "/n" means line break.

Error found in script provided by PatrickE. This last line should be:


You can also add header information:

$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "To: ".$name." <".$email.">\r\n";
$headers .= "From: Someone <>\r\n";
$headers .= "Cc:\r\n";
$headers .= "Bcc:\r\n";

mail($sendto, $subject, $body, $headers);


Thanks. I will give this a try.


This is what I have working now:

mail("","Form Submitted at your website",$message,"From: phpFormGenerator");

How do I make it send the messge to multiple addresses? Does the following do it?

mail(",","Form Submitted at your website",$message,"From: phpFormGenerator");



Your code will work. It would be easy to see by breaking down the code

// get data
$email = $_POST["email"];

// use comma to separate email address
$to = "" . ", ";
$to .= $email . ", " ;
$to .= "" ;

// finally,
mail($to, $subject, $message);

Your code will work.



Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.