Guest User

Untitled

a guest
May 2nd, 2018
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1.  
  2. <?php
  3. if (!defined('HAS_ABILITY')) Header('Location: /');
  4.  
  5. // the email address can be either; "erick@wealthen.biz" or array("craig@coaching-instiute.com", "milefive@hotmail.com", "zach3@zach.com");
  6. $to_email_address = "erick@wealthen.biz"; "milefive@hotmail.com";
  7.  
  8. // the email subject
  9. $email_subject = "WEN Powerpoint";
  10.  
  11. // make the email body
  12. $email_body = "Submitted from: "Submitted from: {$_SERVER['HTTP_HOST']}/powerpoint\n\n";
  13.  
  14. // append the details onto the email body
  15. foreach ($_POST as $key => $val)
  16. {
  17. $email_body .= "{$key} -> {$val}\n\n";
  18. }
  19.  
  20. // send mail function (just so we dont keep rewriting code)
  21. function sendMail($to_email_address, $email_subject, $email_body)
  22. {
  23. if (!mail($to_email_address, $email_subject, $email_body))
  24. {
  25. echo "<h1>Error Sending Email.</h1>";
  26. }
  27. }
  28.  
  29. // check if the email addy is a string or an array, then send the email
  30. if (is_string($to_email_address))
  31. {
  32. sendMail($to_email_address, $email_subject, $email_body);
  33. }
  34. else if (is_array($to_email_address))
  35. {
  36. foreach ($to_email_address as $email_address)
  37. {
  38. sendMail($email_address, $email_subject, $email_body);
  39. }
  40. }
  41.  
  42. ?>
Add Comment
Please, Sign In to add comment