Guest User

Untitled

a guest
Jul 19th, 2018
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.69 KB | None | 0 0
  1. <?php
  2.  
  3.  
  4.  
  5. // Variables Requested from Form
  6.  
  7.  
  8.  
  9. $name = $_REQUEST['name'];
  10.  
  11. $email = $_REQUEST['email'];
  12.  
  13. $address = $_REQUEST['address'];
  14.  
  15. $city = $_REQUEST['city'];
  16.  
  17. $state = $_REQUEST['state'];
  18.  
  19. $zip = $_REQUEST['zip'];
  20.  
  21. $phone = $_REQUEST['phone'];
  22.  
  23. $contact = $_REQUEST['contact'];
  24.  
  25. $comment = $_REQUEST['comment'];
  26.  
  27.  
  28.  
  29. // Parameters
  30.  
  31.  
  32.  
  33. $email_recipient = "info@californiacustoms.net";
  34.  
  35. $email_content_type = "text/html; charset=us-ascii";
  36.  
  37. $email_client = "PHP/" . phpversion();
  38.  
  39.  
  40.  
  41. // Headers
  42.  
  43.  
  44.  
  45. $email_header = "From: " . $name . "\r\n";
  46.  
  47. $email_header .= "Reply-To: " . $email . "\r\n";
  48.  
  49. $email_header .= "Return-Path: " . $email . "\r\n";
  50.  
  51. $email_header .= "Content-type: " . $email_content_type . "\r\n";
  52.  
  53. $email_header .= "X-Mailer: " . $email_client . "\r\n";
  54.  
  55.  
  56.  
  57. // Subject & Contents
  58.  
  59.  
  60.  
  61. $email_subject = "$name Is Requsting Info";
  62.  
  63. $email_contents = "<html>";
  64.  
  65. $email_contents .= "<br>Name:" . $name;
  66.  
  67. $email_contents .= "<br>E-Mail:" . $email;
  68.  
  69. $email_contents .= "<br>Address:" . $address;
  70.  
  71. $email_contents .= "<br>City:" . $city;
  72.  
  73. $email_contents .= "<br>State:" . $state;
  74.  
  75. $email_contents .= "<br>Zip Code:" . $zip;
  76.  
  77. $email_contents .= "<br>Phone Number:" . $phone;
  78.  
  79. $email_contents .= "<br>Preffered Method of Contact:" . $contact;
  80.  
  81. $email_contents .= "<br>Comments:" . $comment;
  82.  
  83. $email_contents .= "</html>";
  84.  
  85.  
  86.  
  87. // Result Handling
  88.  
  89.  
  90.  
  91. $email_result = mail($email_recipient, $email_subject, $email_contents, $email_header);
  92.  
  93. if ($email_result) echo "Email has been sent!";
  94.  
  95. else echo "Email has failed!";
  96.  
  97.  
  98.  
  99. ?>
Add Comment
Please, Sign In to add comment