Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if(isset($_POST['submit'])){
- $to = "email@example.com"; // this is your Email address
- $from = $_POST['email']; // this is the sender's Email address
- $first_name = $_POST['first_name'];
- $last_name = $_POST['last_name'];
- $subject = "Form submission";
- $message = $first_name . " " . $last_name . " wrote the following:" . "\n\n" . $_POST['message'];
- $headers = "From:" . $from;
- mail($to,$subject,$message,$headers);
- echo "Mail Sent. Thank you " . $first_name . ", we will contact you shortly.";
- }
- ?>
- <html>
- <head>
- </head>
- <body>
- <form action="" method="post">
- First Name: <input type="text" name="first_name"><br>
- Last Name: <input type="text" name="last_name"><br>
- Email: <input type="text" name="email"><br>
- Message:<br><textarea rows="5" name="message" cols="30"></textarea><br>
- <input type="submit" name="submit" value="Submit">
- </form>
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement