Sending problem in contact form Bigstream Wordpress theme, configuration of mail-it.php file

Asked

Viewed 64 times

0

I am not managing to make contact form of the wordpress theme Bigstream work, when I click to send it shows success message but the email does not arrive.

I found the following file 'mail-it.php' but I don’t know exactly how to configure, I tried to put my email in it but it didn’t help.

Does anyone have any idea how to set up the email below?

<?php

/* Code by David McKeown - craftedbydavid.com */
/* Editable entries are bellow */

$send_to = "[email protected]";
$send_subject = "Ajax form";



/*Be careful when editing below this line */

$f_name = cleanupentries($_POST["name"]);
$f_email = cleanupentries($_POST["email"]);
$f_message = cleanupentries($_POST["message"]);
$from_ip = $_SERVER['REMOTE_ADDR'];
$from_browser = $_SERVER['HTTP_USER_AGENT'];


function cleanupentries($entry) {
    $entry = trim($entry);
    $entry = stripslashes($entry);
    $entry = htmlspecialchars($entry);

    return $entry;
}

$message = "This email was submitted on " . date('m-d-Y') .
"\n\nName: " . esc_attr( $f_name ) .
"\n\nE-Mail: " . esc_attr( $f_email ).
"\n\nMessage: \n" . ff_wp_kses( $f_message ) .
"\n\n\nTechnical Details:\n" . esc_attr( $from_ip ) . "\n" . esc_attr( $from_browser );

$send_subject .= " - {$f_name}";

$headers = "From: " . esc_attr( $f_email ) . "\r\n" .
    "Reply-To: " . esc_attr( $f_email ) . "\r\n" .
    "X-Mailer: PHP/" . phpversion();

if (!$f_email) {
    echo "no email";
    exit;
}else if (!$f_name){
    echo "no name";
    exit;
}else{
    if (filter_var($f_email, FILTER_VALIDATE_EMAIL)) {
        mail($send_to, $send_subject, $message, $headers);
        echo "true";
    }else{
        echo "invalid email";
        exit;
    }
}

?>
  • Already tested the mail function <?php if (mail('[email protected]', 'teste', 'teste mensagem', 'From: <[email protected]>')) echo 'enviou!'; ?> , to see if it is enabled on your server?

  • @Ivanferrer humm I did not test, as I would do. It is hosted on Ocaweb ...

  • Create a send.php file and run it, and put the data in the function, just like I did, only with the actual data and see if it prints on the "sent" screen and see if you received the email.

  • Locaweb has some patterns, see here.

  • @Ivanferrer showed up sent but no email arrived ... I’ll see this thing from Ocaweb ...

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.