SHARE
TWEET

Untitled

a guest Jan 20th, 2017 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <form method="post" action="sendmail.php">
  2. <div class="field half first">
  3. <label for="name">Name</label>
  4. <input type="text" name="name" id="name" placeholder="Your Name" />
  5. </div>
  6. <div class="field half">
  7. <label for="email">Email</label>
  8. <input type="text" name="email" id="email" placeholder="your@mail.com" />
  9. </div>
  10. <div class="field">
  11. <label for="subject">Subject</label>
  12. <input type="text" name="subject" id="subject" placeholder="Subject..." />
  13. </div>
  14. <div class="field">
  15. <label for="message">Message</label>
  16. <textarea name="message" id="message" rows="4"></textarea>
  17. </div>
  18. <ul class="actions">
  19. <li><input type="submit" value="Send Message" class="special" /></li>
  20. <li><input type="reset" value="Reset" /></li>
  21. </ul>
  22. </form>
  23.    
  24. <?php
  25.   $to = "test@mydomain.com";
  26.   $email = $_REQUEST['email'] ;
  27.   $name = $_REQUEST['name'] ;
  28.   //$site = $_REQUEST['site'] ;
  29.   $subject = $_REQUEST['subject'] ;
  30.   $message = $_REQUEST['message'] ;
  31.   $headers = "test@mydomain.com";
  32.   $body = "From: $name nn Email: $email nn Message: $message";
  33.   $sent = mail($to, $subject, $body, $headers) ;
  34.   if($sent)
  35.     {echo "<script language=javascript>window.location = 'http://mydomain.com/#contact';</script>";}
  36.   else
  37.     {echo "<script language=javascript>window.location = 'http://mydomain.com/';</script>";}
  38. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top