Advertisement
Guest User

Untitled

a guest
Jan 15th, 2017
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.71 KB | None | 0 0
  1. <form method="post" action="index.php">
  2. <div class="row 50%">
  3. <div class="6u 12u(mobile)"><input name="name" type="text" placeholder="Name" /></div>
  4. <div class="6u 12u(mobile)"><input name="email" type="text" placeholder="Email" /></div>
  5. </div>
  6. <div class="row 50%">
  7. <div class="12u"><textarea name="message" placeholder="Message"></textarea></div>
  8. </div>
  9. <div class="row">
  10. <div class="12u">
  11. <ul class="actions">
  12. <li><input type="reset" class="button alt" value="Clear Form" /></li>
  13. <li><input name="submit" type="submit" class="button" value="Send Message" /></li>
  14. </ul>
  15. </div>
  16. </div>
  17. </form>
  18.  
  19. <?php
  20. if (isset($_POST["submit"])) {
  21. $name = $_POST['name'];
  22. $email = $_POST['email'];
  23. $message = $_POST['message'];
  24. $from = 'Demo Contact Form';
  25. $to = "xxxxx@gmail.com";
  26. $subject = 'Message from Contact Demo ';
  27. $body = "From: $namen E-Mail: $emailn Message:n $message";
  28.  
  29. if (mail ($to, $subject, $body, $from)) {
  30. $result='Thank You! I will be in touch';
  31. echo 'test success';
  32. } else {
  33. $result='Sorry there was an error sending your message.';
  34. }
  35. }
  36. ?>
  37.  
  38. mail function
  39. ; For Win32 only.
  40. ; http://php.net/smtp
  41. ; SMTP=smtp.gmail.com
  42. ; http://php.net/smtp-port
  43. ; smtp_port=25
  44.  
  45. ; For Win32 only.
  46. ; http://php.net/sendmail-from
  47. ; sendmail_from = your@gmail.com
  48.  
  49. ; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
  50. ; http://php.net/sendmail-path
  51. sendmail_path = ""C:xamppsendmailsendmail.exe" -t"
  52.  
  53. sendmail
  54. smtp_server=smtp.gmail.com
  55. smtp_port=465
  56. error_logfile=error.log
  57. debug_logfile=debug.log
  58. auth_username=your@gmail.com
  59. auth_password=yourpassword
  60. force_sender=your@gmail.com
  61. hostname=localhost
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement