Jump to content

Search the Community

Showing results for tags 'mailfail'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. <?php $suspect = false; $pattern = '/Content-Type:|Bcc:|Cc:/i'; function isSuspect($val, $pattern, &$suspect) { if (is_array($val)) { foreach ($val as $item) { isSuspect($item, $pattern, $suspect); } } else { if (preg_match($pattern, $val)) { $suspect = true; } } } isSuspect($_POST, $pattern, $suspect); if (is_array($val)) { foreach ($val as $item) { isSuspect($item, $pattern, $suspect); } } else { if (preg_match($pattern, $val)) { $suspect = true; } } isSuspect($_POST, $pattern, $suspect); if (!$suspect) { foreach ($_POST as $key => $value) { $temp = is_array($value) ? $value : trim($value); if (empty($temp) && in_array($key, $required)) { $missing[] = $key; $$key = ''; } elseif (in_array($key, $expected)) { $$key = $temp; } } } if (!$suspect && !empty($b_mail)) { $validemail = filter_input(INPUT_POST, 'b_mail', FILTER_VALIDATE_EMAIL); if ($validemail) { $headers .= "\r\nReply-to: $validemail"; } else { $errors['b_mail'] = true; } } if (!$suspect && !$missing && !$errors) { $message = ''; foreach ($expected as $item) { if (isset($$item) && !empty($$item)) { $val = $$item; } else { $val = 'Not selected'; } if (is_array($val)) { $val = implode(', ', $val); } $item = str_replace(array('_', '-'), ' ', $item); $message .= ucfirst($item) . ": $val\r\n\r\n"; } $message = wordwrap($message, 70); $mailSent = mail($to, $subject, $message, $headers, $authenticate); if (!$mailsent) { $errors['mailfail'] = true; } } ?> <?php if (($_POST && $suspect) || ($_POST && isset($errors['mailfail']))) { ?> <p class="warning">Sorry your message could not be sent.</p> <?php echo ($suspect)?> <?php } elseif ($errors || $missing) { ?> <p class="warning">Please fix the item(s) indicated.</p> <?php }?> <?php $errors = array(); $missing = array(); if (isset($_POST['submit'])) { $to = "Carel Venter <bookings@bushveldgolf.co.za>"; $subject = "Booking"; $expected = array('b_name', 'b_surn', 'b_tele', 'b_mail', 'b_acco', 'b_golf', 'b_nong', 'b_pack', 'b_courses', 'b_dfrom', 'b_dto'); $required = array('b_name', 'b_surn', 'b_tele', 'b_mail', 'b_acco', 'b_golf', 'b_pack', 'b_courses', 'b_dfrom', 'b_dto'); if (!isset($_POST['b_courses'])) { $_POST['b_courses'] = array(); } if(!is_array($_POST['b_courses'])) { $_POST['b_courses'] = array($_POST['b_courses']); } $minimumChecked = 1; if (count($_POST['b_courses']) < $minimumChecked) { $errors['b_courses'] = true;} $headers = "From:" .$b_mail. "\r\n"; $headers .= "Content-Type: text/plain; charset=utf-8\r\n"; $authenticate = '-fcarel@bushveldgolf.co.za'; require './php_include/mail_process2.php'; if($mailsent) { //echo "Thank you, I wil get back to you soon."; header('Location:/thanks.php'); exit; } } ?> Hi, thank you for your time. I have this booking form, and its sends the email perfect. I get it with all the fields. The error message however keeps on appearing and it doesn't go to the thank you page. I include the top of the page, the top of the form, and the mail process form. I would really appreciate help.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.