I am very new to PHP and hope that someone here might be able to help with a challenge I cannot solve (yet).
I have created a simple hmtl form and corresponding php file which send some information to the designated email. However, I am not sure how to get all of the fields from the form into the email with a prefix.
In my email, I get exactly what I typed into the field 'message'. but what I would like is to have multiple fields included each with a label...such as:
HTML: <form method="post" action="selfsendmail.php"> <table border="1" cellspacing="5%"><tr> <td><p>Please enter your email address:</p></td> <td><input name="email" type="text" /></td> </tr> <tr> <td><p>Message:</p></td> <td><textarea name="message" rows="10" cols="30" ></textarea></td> </tr> <tr> <td><p>Please enter your favourite colour:</p></td> <td><input type="text" name="FavColour" /></td> </tr> <tr> <td><p>Please hit submit: </p></td> <td><input type="submit" /></td> </tr></table> </form> PHP: <? $email = $_POST['email'] ; $message = $_POST['message'] ; mail( "firstname.lastname@example.org", "Application Form", $message, "From: CCV@canadaclub.com.au" ); print "Wooohooo your email has been sent"; ?>
Thanks in advance.