You can't do it with just HTML, you need something for the mail sending. Well actually you can do it, but its real clumsy and awful method.
The form itself is easy to do, just plain HTML.
It could look something like this:
CODE
<form action="[mailing script]" method="post">
<label for="firstname">First name</label>
<input type="text" id="firstname" name="firstname"/>
(and so on..)
<input type="submit" value="Send"/>
</form>
[/CODE]
<label>s are a modern and stylish way to do this, and to make them look good you need to do some CSS. Other way, the typical one, is to build a table with the form elements inside the cells.
For the dates and the amazon thing you could use select elements:
CODE
<select name="amazon">
<option value="com">Amazon.com</option>
<option value="de">Amazon.de</option>
and so on
</select>
So far pretty straight forward. Next you need to do some programming.
[/CODE]
You need to have a program in the server to send the mail. Probably easiest way to do it is PHP.
Basically all you need to send email in PHP is to call function called mail(). As parameters it takes email address (where the message is to be sent), subject, the message itself and headers.
You can access the data from the form with $_POST['variable'], provided that you used post as method instead of get. For mailing, post is recommended.
Before calling mail, you need to do some processing with your data. You can do checks wether the fields are filled correctly and so on. Then you need to compile the information into the message format. I'd also recommend adding some headers to make the mail a little neater and easier for the recipient (ie. you) to reply.
The very basic script could look something like this:
CODE
<?php
$message = 'Firstname: '.$_POST['firstname']. "\n".
.'Lastname: '.$_POST['lastname']."\n";
and so on...
$headers = "Reply-To: ". $_POST['email']."\n";
$headers .= "X-Mailer: PHP/" . phpversion();
mail('your@email.com', 'Subject', $message, $headers);
?>
You can of course format the message in anyways you see best, even use HTML if you like HTML mail. For the header, you can do lot of things, if your interested google or visit php.net.
The above script should work, but its recommeded to at least check that the mailing works and then print out a message for the user. Mail returns true if the message was sent, false if not.
So to check and print the message:
CODE
if ( mail( ----stuff inside----) )
{
[tab][/tab]echo "Mail was sent";
}
else
{
[tab][/tab]echo "Mail was not sent";
}
;
Hopefully this helped to get you started.
Comment/Reply (w/o sign-up)