Advertisement
Guest User

mailer.php

a guest
Nov 24th, 2014
1,214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. <?PHP
  2.  
  3.  
  4. $subject = "Contact Page";
  5.  
  6. $headers = "From: Contact Page";
  7.  
  8. $forward = 0;
  9.  
  10. $location = "";
  11.  
  12.  
  13.  
  14. $date = date ("l, F jS, Y");
  15.  
  16. $time = date ("h:i A");
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24. $msg = "Below is the result of your feedback form. It was submitted on $date at $time.\n\n";
  25.  
  26.  
  27.  
  28. if ($_SERVER['REQUEST_METHOD'] == "POST") {
  29.  
  30. foreach ($_POST as $key => $value) {
  31.  
  32. $msg .= ucfirst ($key) ." : ". $value . "\n";
  33.  
  34. }
  35.  
  36. }
  37.  
  38. else {
  39.  
  40. foreach ($_GET as $key => $value) {
  41.  
  42. $msg .= ucfirst ($key) ." : ". $value . "\n";
  43.  
  44. }
  45.  
  46. }
  47.  
  48.  
  49.  
  50. mail($to, $subject, $msg, $headers);
  51.  
  52. if ($forward == 1) {
  53.  
  54. header ("Location:$location");
  55.  
  56. }
  57.  
  58.  
  59.  
  60. else {
  61.  
  62. include("index.html");
  63.  
  64. }
  65.  
  66.  
  67.  
  68. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement