Web Design Forum: Email verification script no longer working - fsockopen unable to connect? - Web Design Forum

Jump to content

WDF
WDF Premium Memberships Reseller Hosting
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Email verification script no longer working - fsockopen unable to connect? Rate Topic: -----

#1 User is offline   webbhost 

  • Dedicated Member
  • PipPip
  • Group: Members
  • Posts: 192
  • Joined: 12-May 08
  • Reputation: 0
  • Experience:Intermediate
  • Area of Expertise:Designer/Coder

Posted 29 January 2012 - 10:01 PM

Okay, so I wrote this script a good while ago, and it worked fine at the time, but all of a sudden, I've gone to re-use it and I get an error message? Im wondering if a php version update is causing the sudden error or something, can someone help determine whats cracking off? Doesn't matter what e-mail address I use, valid or not I get the same response

Thanks

The response I am getting is:

Warning: fsockopen() [function.fsockopen]: unable to connect to naypalm.net:25 (Connection timed out) in /home/battlesn/public_html/includes/phpClasses/InputController.php on line 120
0


I am running the page as:

/LiveAssistanceHandle.php?ValidateEmail=nay@naypalm.net
The code this links to:

}elseif ($_GET['ValidateEmail']){
    $email = $_GET['ValidateEmail'];

    $ic = new inputController();
    $ic->setData($email);
    $ic->email();
    echo $ic->lastResult;
    

}




And the email function from the class which is trying but failing to get the result...

	public function email(){
	$this->log("email function initiated.. ", $this->dbln);
		if(eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $this->data)) { 
			$this->log("Email address validated... Attempting to search for domain records in DNS...", $this->dbln);
			list($username,$domain)=split('@',$this->data);
			if(!checkdnsrr($domain,'MX')) {
				$this->handleOutcome(0);
				return false;
		
			}
			$this->log("MX dns entry validated..  attempting to open a socket connection to ensure servers mail is up and running..", $this->dbln);
			// attempts a socket connection to mail server
			if(!fsockopen($domain,25,$errno,$errstr,30)) {
				$this->handleOutcome(0);
				return false;
			}


			$this->handleOutcome(1);
			return true;
		}else{
			$this->handleOutcome(0);
			return false;
	
		}


	}

This post has been edited by webbhost: 29 January 2012 - 10:02 PM

0

#2 User is offline   webbhost 

  • Dedicated Member
  • PipPip
  • Group: Members
  • Posts: 192
  • Joined: 12-May 08
  • Reputation: 0
  • Experience:Intermediate
  • Area of Expertise:Designer/Coder

Posted 30 January 2012 - 02:10 PM

For anyone that stumbles over this with the same problem.. I got in touch with my hosting providers and it turns out that they have port 25 turned off for outgoing connections to prevent spam.. therefore giving me the time out message.

Anyone happen to know of a free host that accepts outgoing :25?
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users