E-Mail Form Submission
I am using Dreamweaver MX using PHP & MySQL. What's the easiest way to submit the contents of a form to a specified e-mail address?
Thanks
I am using Dreamweaver MX using PHP & MySQL. What's the easiest way to submit the contents of a form to a specified e-mail address?
Thanks
Comments
Smart Mailer PHP
Check out the Smart Mailer extension here at DMXzone.
http://www.dmxzone.com/go?5628
Martha Graham
DMXzone.com
The easiest way...
Basically, you pass the form parameters to a new page, which has the email sendind code in it.
You need to fill the following line with data:
mail ($to, $subject, $message, $headers);
You can replace the variables with $_POST variables directly, but it is easier to manage if you construct the various parts of the message separately.
Start with $subject = "Hello world"; or $subject = $_POST['subject']; (if you can get it from the form field "subject")
Now $to = "your@email.com"; or $to = $_POST['email']; (if you had that field filled in in the form)
Let's take headers now:
$headers = "From: from@email.com\r\n" ;
$headers.= "Reply-To: reply@email.com\r\n" ;
$headers .= "Cc: additional@emails.com\r\n";
$headers .= "Bcc: blind@email.com\r\n";
You can leave out the additional headers like cc or bcc
As to the message:
$message = "Your message, lines terminated by \n" or $message = $_POST['textarea'];
As long as you define the variables before the mail () function, it should work.
Kutt (kutt@fullnet.ee)
You must me logged in to write a comment.