Advertisement
Guest User

mailer.php

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