Socket/Check Mail problem
Posted: Sun Jul 24, 2005 6:27 pm
The Function:
The Code:
$email = from a previous page/form
The Error:
Code: Select all
<?php
function checkEmail($email)
{
if(eregi("^[a-zA-Z0-9_]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$]", $e))
{
return FALSE;
}
list($Username, $Domain) = split("@",$e);
if(getmxrr($Domain, $MXHost))
{
return TRUE;
}
else
{
if(fsockopen($Domain, 25, $errno, $errstr, 30))
{
return TRUE;
}
else
{
return FALSE;
}
}
}
?>The Code:
Code: Select all
<?php
if(checkEmail($email) == FALSE) {
echo "E-mail entered is not valid.";
} else {
echo "E-mail entered is valid.";
}
?>The Error:
Line 17 = <?php if(fsockopen($Domain, 25, $errno, $errstr, 30)) ?>Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /home/steve/public_html/teamexileonline/index.php on line 17
Warning: fsockopen(): unable to connect to :25 in /home/steve/public_html/teamexileonline/index.php on line 17