• odaku128

    (@odaku128)


    I use a mailer.php to email form data to an external email address.

    The one i normally use does not work inside wordpress.

    It simply will not process the form data and also the redirect does nothing.

    Does anyone know how to resolve this?

    My forms have four fields and i need the data and date and time sent.

    Cheers

Viewing 1 replies (of 1 total)
  • Thread Starter odaku128

    (@odaku128)

    Do Mailer.php’s work inside of wordpress?

    Is There a special way to write them?

    This is mine:

    <?php
    $to = "to";
    $subject = "subject";
    $headers = "From: header";
    $forward = 1;
    $location = "https://www.site.com";
    $date = date ("l, F jS, Y");
    $time = date ("h:i A"); 
    
    $msg = "Below is the result of your feedback form. It was submitted on $date at $time.\n\n"; 
    
    if ($_SERVER['REQUEST_METHOD'] == "POST") {
        foreach ($_POST as $key => $value) {
            $msg .= ucfirst ($key) ." : ". $value . "\n";
        }
    }
    else {
        foreach ($_GET as $key => $value) {
            $msg .= ucfirst ($key) ." : ". $value . "\n";
        }
    }
    
    mail($to, $subject, $msg, $headers, -f$headers);
    if ($forward == 1) {
        header ("Location:$location");
    }
    else {
        echo "Thank you for submitting our form. We will get back to you as soon as possible.";
    } 
    
    ?>
Viewing 1 replies (of 1 total)
  • The topic ‘Mailer.php’ is closed to new replies.