Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if (!defined('HAS_ABILITY')) Header('Location: /');
- // the email address can be either; "erick@wealthen.biz" or array("craig@coaching-instiute.com", "milefive@hotmail.com", "zach3@zach.com");
- $to_email_address = "erick@wealthen.biz"; "milefive@hotmail.com";
- // the email subject
- $email_subject = "WEN Powerpoint";
- // make the email body
- $email_body = "Submitted from: "Submitted from: {$_SERVER['HTTP_HOST']}/powerpoint\n\n";
- // append the details onto the email body
- foreach ($_POST as $key => $val)
- {
- $email_body .= "{$key} -> {$val}\n\n";
- }
- // send mail function (just so we dont keep rewriting code)
- function sendMail($to_email_address, $email_subject, $email_body)
- {
- if (!mail($to_email_address, $email_subject, $email_body))
- {
- echo "<h1>Error Sending Email.</h1>";
- }
- }
- // check if the email addy is a string or an array, then send the email
- if (is_string($to_email_address))
- {
- sendMail($to_email_address, $email_subject, $email_body);
- }
- else if (is_array($to_email_address))
- {
- foreach ($to_email_address as $email_address)
- {
- sendMail($email_address, $email_subject, $email_body);
- }
- }
- ?>
Add Comment
Please, Sign In to add comment