Veckn
Below are a code to create a simple form mail in a site like a "contact us" form:
It is needed 2 archives:
contact.php (can be ".htm" or "html")
sendmail.php
The contact.php
The sendmail.php
Enjoy your code =)
It is needed 2 archives:
contact.php (can be ".htm" or "html")
sendmail.php
The contact.php
| Code: |
| <html>
<head> <title>Site Title</title> </head> <body> <form action="sendmail.php" method="post" name="contact" id="contact"> <table width="768" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="right">Name:</td> <td><input name="name" type="text" id="name" size="30" maxlength="50"></td> </tr> <tr> <td align="right">E-mail:</td> <td> <input name="email" type="text" id="email" size="30" maxlength="50"></td> </tr> <tr> <td align="right" valign="top">Message:</td> <td><textarea name="message" cols="40" rows="5" id="message"></textarea></td> </tr> <tr> <td> </td> <td> <input name="submit" type="submit" id="submit" value="Send"> <input name="reset" type="reset" id="reset" value="Reset"> </tr> </table> </form> </body> </html> |
The sendmail.php
| Code: |
| <?php
// Vars for the form $name = $_POST['name']; $email = $_POST['email']; $message = $_POST['msg']; $msg = "Name: \t$name\n"; $msg .= "Email: \t$email\n"; $msg .= "Message: \t$message\n\n"; mail("your_email_here","Contact Form",$cabecalho.$msg); ?> <html> <head> <title>Site title</title> </head> <body> <table width="768" border="0" cellspacing="0" cellpadding="0"> <tr> <td><p>Thank you <?php echo $nome ?>.</p> </td> </tr> </table> </body> </html> |
Enjoy your code =)
