"getaddrinfo failed" usually means a name resolution error such as DNS
lookup failing.
David Genord II
On Wed, Apr 29, 2009 at 2:44 PM, Renee Starkey <[log in to unmask]> wrote:
> Hello
>
> I am trying to use fsockopen() php function to check a valid email address.
> Here is a code snippet:
>
> function checkEmail($email) {
> if(eregi("^[a-zA-Z0-9_]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$]", $email)) {
> return FALSE;
> }
> list($Username, $Domain) = split("@",$email);
> if(getmxrr($Domain, $MXHost)) {
> return TRUE;
> } else {
> if(fsockopen($Domain,25,$errno,$errstr,30)) {
> return TRUE;
> } else {
> return FALSE;
> }
> }
> }
> Here is the error from the browser:
>
> Warning: fsockopen() [function.fsockopen]: php_network_getaddresses:
> getaddrinfo failed: Name or service not known in file name line...
>
> Here is the failing on the if(fsockopen($Domain,25,$errno,$errstr,30))
> line. Does anyone out there have any experience with this error?? I am
> using a LAMP server.
>
> Thank you,
>
> Renee Starkey @}-----}-----
> Information Technologist I
> 115 Old Horticulture
> Language Learning Center, Michigan State University
> Phone: 517-355-7587
>
>
> Renee Starkey ;-)
> "Strive to be the best you can be at any given moment in life" RmS
>
|