Всем привет.
Не отправляются письма на почту если в поле text введено больше 25 символов. Ограничений не стоит. В чем проблема может быть?
<?php
include_once($_SERVER['DOCUMENT_ROOT'].'/wp-config.php' );
$name=$_REQUEST['name'];
$tel=$_REQUEST['tel'];
$email=$_REQUEST['email'];
$cupon=$_REQUEST['cupon'];
$table=$_REQUEST['time'];
$date=$_REQUEST['date'];
$pname= $_REQUEST['tpagename'];
$gamer=$_REQUEST['gamer'];
$dat=date("d.m.Y");
if (!empty($name) && !empty($tel) && !empty($email) && !empty($table) && !empty($date) && !empty($pname) && !empty($gamer)) {
global $wpdb;
$rows = $wpdb->get_var("SELECT COUNT(*) FROM `" . $table . "` WHERE `date`='" . $date . "' AND `booked`=1" );
$email_subject = "Quest Reservation $pname";
$email_message = "
Name of the quest: $pname
Name: $name
Phone: $tel
E-Mail: $email
Date: $date
Time: $table
Number of players: $gamer
Code: $cupon";
$headers = "From: Exitmania.lv <info@exitmania.lv>\n";
$headers .= "Content-Type: text/plain; charset=UTF-8\n";
//echo $rows;
if($rows == "0") {
$insert=$wpdb->update( $table, array( 'name' => $name,'booked' => '1', 'email' => $email, 'cupon' => $cupon, 'phone' => $tel, 'gamer' => $gamer ), array( 'date' => $date ,'pname'=>$pname ) );
if (!empty($insert)) {
echo "<div class='messege-ok'> RESERVATION COMPLETED! See you soon!</div>";
mail( $email, $email_subject, $email_message, $headers);
mail( "info@exitmania.lv", "New reservation quest (from : $name)", $email_message, $headers);
} else {
echo "<div class='messege-failed'>Error! Something wrong with the server.</div>";
}
} else {
echo "<div class='messege-failed'>Error! This quest is already booked!</div>";
}
}
?>