Step 1: Copy the entire HTML-code as given below into a new file and
enter in the yourname@domain.com fields YOUR email address. Note: the email.gif file should be in the same directory as this file. Otherwise you need to enter the directory to which the image will be saved. Save the file under the name emailform.html. View the example: <html> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"> <meta name="author" content="Johannes P Wilbrand"> <meta name="description" content="E-Mail Form E-Mail Formular Guestbook Gästebuch"> <meta name="keywords" content="E-Mail,E-Mailform,E-Mail Formular,Email,Email Formular,Emailform,Emailformular,email,emailform,emailformular,Guestbook,Gästebuch"> <title>E-Mail Form</title> </head> <body text="#000000" bgcolor="#D8BEEE"> <center> <table border="0" cellspacing="0" cellpadding="0"> <tr> <td WIDTH="750"> <br><b><font face="Bookman Old Style" color="#0000A0" size="+2">Send E-Mail</font></b> <form name="Emailform" method="post" action="emailsend.php"> <font face="Bookman Old Style" color="#000080" size="-1">Full Name: <br><input type="text" name="FullName" size="50"><br> <br>Please enter your complete email address: <br><input type="text" name="EmailAddress" value="yourname@domain.com" size="50" maxwidth="60"><br> <br>If you have a website please enter your URL: <br><input type="text" name="Website" value="http://" size="50"><br> <br>Message: <br><textarea name="Email" cols="75" rows="15" style="width:600px" wrap="virtual"></textarea></font> <p> <input TYPE="submit" VALUE="Post Message"> <input TYPE="reset" VALUE="Made a Mistake?"> <p> <img src="email.gif" align="middle" border="0" alt="yourname@domain.com"> <font face="Comic Sans MS" size="2" color="#0000A0">click <a href="mailto:yourname@domain.com">here</a> should you wish to send email the classic way.</font> </form> </td> </tr> </table></center> </body> </html> |
Step 2: Copy the entire HTML-code as given below into a new file.
Save the file under the name emailthanks.html in the same directory as the emailform.html file. View the example: <html> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"> <meta name="author" content="Johannes P Wilbrand"> <meta name="description" content="E-Mail Form E-Mail Formular Guestbook Gästebuch"> <meta name="keywords" content="E-Mail,E-Mailform,E-Mail Formular,Email,Email Formular,Emailform,Emailformular,email,emailform,emailformular,Guestbook,Gästebuch"> <title>Thank You!</title> </head> <body text="#000080" bgcolor="#D8BEEE"> <center> <table valign="center" height="75%" width="65%" cellspacing="0" cellpadding="0"> <tr> <td align="center" valign="center"> <center><font face="Bookman Old Style" size="+3" color="#000080"><b>Thank you kindly for your message!<br> <br>Please visit this site again soon!</b></font></center></td></tr> </table> </center> </body> </html> |
Step 3: Copy the entire PHP-code as given below into a new file and
enter in the yourname@domain.com field YOUR email address. Save the file under the name emailsend.php in the same directory as the emailform.html and emailthanks.html files. Note: the emailsend.php file should be in the same directory as the emailform.html file. Else you need to enter in the emailform.html file the directory to which the emailsend.php file will be saved. Furthermore, it is very important that you DO enter the directory, to which the emailthanks.html file refers, in the emailsend.php file under any circumstances, unless you intend to save that file to your root directory, in which case the "/" MUST still precede the file name. Example: To refer to the emailthanks.html file as if located in the root directory the last line must read: header('Location: http://'.getenv('HTTP_HOST').'/emailthanks.html'); or to refer to the emailthanks.html file as if located in a directory named communication for instance the last line must read: header('Location: http://'.getenv('HTTP_HOST').'/communication/emailthanks.html'); <?php $admin= 'yourname@domain.com'; $subject= 'Emailform'; $message= 'Message to '.$admin.' from '.$email.":\n\n"; foreach($HTTP_POST_VARS as $name=> $value) { $message.= "$name: $value\n"; } $message = WORDWRAP($message,75,"\n"); mail($admin, $subject, STRIPSLASHES( $message ) , "From: $email"); header('Location: http://'.getenv('HTTP_HOST').'/directory/emailthanks.html'); ?> |
![]() |
Please note: Should you make use of the download files you still need to
enter in the relevant yourname@domain.com field of each file YOUR email address. Any more |