Witam,
Zainstalowa?am
Advanced contact form i mam perien problem: zg?asza b??d mimo poprawnie wpisanego adresu e-mail, nie umiem znale?? b??du w skrypcie

<?php
/**********************************************************************************
* Contact.php *
***********************************************************************************
* *
* Execution file for "Contact Form" modification. *
* *
* Copyright (c) 2008 by Deprecated (at) Earthlink (dot) net. All rights reserved. *
* Redistribution prohibited except at SimpleMachines.org *
* *
**********************************************************************************/
if (!defined('SMF'))
die('Hacking attempt...');
function Contact()
{
global $context, $settings, $options, $scripturl, $boarddir, $sourcedir, $modSettings, $user_info, $txt, $webmaster_email;
if($user_info['is_guest'] && empty($modSettings['contact_form_enable_guest_access'])) redirectexit();
if(!$user_info['is_guest'] && empty($modSettings['contact_form_enable_member_access'])) redirectexit();
$global_error = false;
if (!empty($modSettings['reg_verification']) && $context['user']['is_guest'])
{
require_once($sourcedir . '/Subs-Editor.php');
$verificationOptions = array(
'id' => 'register',
);
if (isset($_POST['submit']))
{
$context['visual_verification'] = create_control_verification($verificationOptions, true);
if (is_array($context['visual_verification']))
{
loadLanguage('Errors');
foreach ($context['visual_verification'] as $error)
{
$global_error = $context['contact_form_error_visual_verification'] = true;
$context['visual_verification_error_dscr'] = $txt['error_' . $error];
}
}
}
$context['visual_verification'] = create_control_verification($verificationOptions);
$context['visual_verification_id'] = $verificationOptions['id'];
}
else $context['visual_verification'] = false;
$content = '';
$sender_ip = $_SERVER['REMOTE_ADDR'];
$sender_rdns = gethostbyaddr($sender_ip);
if ($context['user']['is_guest']) $sender = $txt['contact_form_sender_is_guest'];
else
{
$sender = $context['user']['name'];
if ($context['user']['name'] != $context['user']['username']) $sender .= ' (' . $context['user']['username'] . ')';
}
$message = isset($_POST['message']) ? trim($_POST['message']) : '';
if (!$message) $global_error = $context['contact_form_error_no_message'] = true;
$sender_name = isset($_POST['name']) ? trim($_POST['name']) : '';
if (!$sender_name && !empty($modSettings['contact_form_require_name'])) $global_error = $context['contact_form_error_no_name'] = true;
if (!$sender_name || !empty($modSettings['contact_form_sender_name_dont_use_form']))
{
$name = empty($modSettings['contact_form_default_name']) ? $txt['contact_form_default_name_default'] : $modSettings['contact_form_default_name'];
if ($sender_name) $content .= $txt['contact_form_label_status_name'] . $sender_name . '
';
}
else $name = $sender_name;
$sender_email = isset($_POST['email']) ? trim($_POST['email']) : '';
if (!$sender_email && !empty($modSettings['contact_form_require_email'])) $global_error = $context['contact_form_error_no_email'] = true;
if ($sender_email && !valid_email($sender_email)) $global_error = $context['contact_form_error_invalid_email'] = true;
if (!$sender_email || !empty($modSettings['contact_form_sender_email_dont_use_form']))
{
$email = empty($modSettings['contact_form_default_email_sender']) ? $webmaster_email : $modSettings['contact_form_default_email_sender'];
if ($sender_email) $content .= $txt['contact_form_label_status_email'] . $sender_email . '
';
}
else $email = $sender_email;
$headers = 'From: ' . $name . ' <' . $email . '>';
$sender_subject = isset($_POST['subject']) ? trim($_POST['subject']) : '';
if (!$sender_subject && !empty($modSettings['contact_form_require_subject'])) $global_error = $context['contact_form_error_no_subject'] = true;
if (!$sender_subject || !empty($modSettings['contact_form_sender_subject_dont_use_form']))
{
$subject = empty($modSettings['contact_form_default_subject']) ? $txt['contact_form_default_subject_default'] : $modSettings['contact_form_default_subject'];
if ($sender_subject) $content .= $txt['contact_form_label_status_subject'] . $sender_subject . '
';
}
else $subject = $sender_subject;
if (!empty($modSettings['contact_form_subject_prefix'])) $subject = $modSettings['contact_form_subject_prefix'] . ' ' . $subject;
if ($content) $content .= $txt['contact_form_label_status_separator'];
$content .= stripslashes($message);
$content .= $txt['contact_form_label_ip'] . $sender_ip . $txt['contact_form_label_rdns'] . $sender_rdns . $txt['contact_form_label_sender'] . $sender;
$dest_email_addr = empty($modSettings['contact_form_dest_email_addr']) ? $webmaster_email : $modSettings['contact_form_dest_email_addr'];
$context['page_title'] = empty($modSettings['contact_form_display_title']) ? $txt['contact_form_title'] : $modSettings['contact_form_display_title'];
if (!$global_error && isset($_POST['submit']))
{
require_once($sourcedir . '/Subs-Post.php');
$context['contact_form_sendmail_override_headers'] = true;
if (sendmail($dest_email_addr, $subject, $content, $headers))
{
$context['contact_form_message_sent'] = true;
$context['page_title'] .= ' - ' . $txt['contact_form_result_message_sent'];
}
else
{
$context['contact_form_message_failed'] = true;
$context['page_title'] .= ' - ' . $txt['contact_form_result_send_mail_failed'];
}
}
else
{
if ($global_error && isset($_POST['submit']))
$context['page_title'] .= ' - ' . $txt['contact_form_result_error'];
}
$context['linktree'][] = array(
'url' => $scripturl.'?action=contact',
'name' => $context['page_title'],
);
loadTemplate('Contact');
}
function valid_email($email)
{
global $modSettings;
$at_ptr = strrpos($email, "@");
if (is_bool($at_ptr) && !$at_ptr) return false;
$domain = substr($email, $at_ptr+1);
$local = substr($email, 0, $at_ptr);
$local_len = strlen($local);
$domain_len = strlen($domain);
if ($local_len < 1 || $local_len > 64 || $domain_len < 1 || $domain_len > 255) return false; // local or domain part length invalid
else if ($local[0] == '.' || $local[$local_len-1] == '.') return false; // local part cannot start or end with dot
else if (preg_match('/\\.\\./', $local)) return false; // local part cannot have two consecutive dots
else if (!preg_match('/^[A-Za-z0-9\\-\\.]+$/', $domain)) return false; // domain part has invalid character
else if (preg_match('/\\.\\./', $domain)) return false; // domain part cannot have two consecutive dots
else if (!preg_match('/^(\\\\.|[A-Za-z0-9!#%&`_=\\/$\'*+?^{}|~.-])+$/', str_replace("\\\\", "", $local))) // exception for quoted
if (!preg_match('/^"(\\\\"|[^"])+"$/', str_replace("\\\\", "", $local))) return false; // local part character invalid except when local part is quoted
if (!empty($modSettings['contact_form_skip_dns_check'])) return true; // mod setting to skip the DNS A/MX record check
if (function_exists('checkdnsrr'))
if (!(checkdnsrr($domain, 'MX') || checkdnsrr($domain, 'A'))) return false; // domain does not have a valid A or MX record
else
if (!(win_checkdnsrr($domain, 'MX') || win_checkdnsrr($domain, 'A'))) return false; // domain does not have a valid A or MX record
return true;
}
function win_checkdnsrr($host, $type)
{
if (!empty($host))
{
exec('nslookup -type=' . $type . ' ' . escapeshellcmd($host), $result);
foreach ($result as $line)
if (eregi("^$hostName", $line)) return true;
}
return false;
}
?>
Czy kto? mi mo?e pomóc?
Z góry dzi?kuj? i pozdrawiam - Sandra