Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <form action="sendemail.php">
- <input type="email" name="email" autocomplete="on" autfocus="autofocus" placeholder="ENTER YOUR EMAIL">
- <input type="submit" value="submit" name="submit">
- </form>
- <?php
- if(!empty($_POST))
- {
- // from the form
- $email = trim(strip_tags($_POST['email']));
- // set here
- $subject = "Contact form submitted! $email";
- $to = '24emal@gmail.com';
- $body = <<<HTML
- $email
- HTML;
- $headers = "From: $email\r\n";
- $headers .= "Content-type: text/html\r\n";
- // send the email
- mail($to, $subject, $body, $headers);
- // redirect afterwords, if needed
- header('Location: index.php');
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement