![]() |
#2 |
Registered User
Join Date: May 2016
Posts: 14
|
Basic PHP email() function code
Below is the code for the basic email function. Code:
<?php //if "email" variable is filled out, send email if (isset($_REQUEST['email'])) { //Email information $admin_email = "[email protected]"; $email = $_REQUEST['email']; $subject = $_REQUEST['subject']; $comment = $_REQUEST['comment']; //send email mail($admin_email, "$subject", $comment, "From:" . $email); //Email response echo "Thank you for contacting us!"; } //if "email" variable is not filled out, display the form else { ?> <form method="post"> Email: <input name="email" type="text" /><br /> Subject: <input name="subject" type="text" /><br /> Message:<br /> <textarea name="comment" rows="15" cols="40"></textarea><br /> <input type="submit" value="Submit" /> </form> <?php } ?> |
![]() |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | Rate This Thread |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to submit html code with php? | eigeehte | Programming General | 2 | 05-26-2014 09:00 PM |
Contact Form | woodyciser | Graphic Design | 0 | 12-26-2013 01:24 AM |
Contact form script problems | ncjbhd | HTML / DHTML | 0 | 10-24-2011 08:42 PM |
form to file script. php or html | mjvndhsb | PHP / mySQL | 0 | 10-07-2011 08:55 PM |