Forum Moderators: mack
The results of this form should go to my email adress. I do not want to use "mailto", because most people do not have this option, but have a hotmail account or something alike.
How should I do this? Can I attach an e-mail account to this form, so all results arrive in my mailbox coming from a single email address?
And how to write it in HTML?
-Find a third party that will do the hard work for you (ussually for free)
-Code it yourself. If you want to take this approach, then first you need to know how to make a form:
[w3schools.com...]
When you have finished making the form, you must find a way to process it. This can be done using a third party (google to find one [google.ca]), or a script that you can download.
If you choose the script, I would recommend the Jack's Formmail Script, which is free and uses PHP.
<?PHP
$to = "my@email.com";
$subject = "New contact";
$headers = "From:Mywebsite";
$forward = 1;
$location = "newthanks.htm";
$date = date ("l, F jS, Y");
$time = date ("h:i A");
$msg = "Below is the result of your feedback form. It was submitted on $date at $time.\n\n";
if ($_SERVER['REQUEST_METHOD'] == "POST") {
foreach ($_POST as $key => $value) {
$msg .= ucfirst ($key) ." : ". $value . "\n";
}
}
else {
foreach ($_GET as $key => $value) {
$msg .= ucfirst ($key) ." : ". $value . "\n";
}
}
mail($to, $subject, $msg, $headers);
if ($forward == 1) {
header ("Location:$location");
}
else {
echo "Thanks! . We will get back to you as soon as possible.";
}
?>