Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected function connect($host) {
- $remote_socket = $host . ':' . $this->connect_port;
- $errnum = 0;
- $errstr = '';
- $this->host = $remote_socket;
- // open connection
- $this->socket = @stream_socket_client(
- $this->host,
- $errnum,
- $errstr,
- $this->connect_timeout,
- STREAM_CLIENT_CONNECT,
- stream_context_create(array())
- );
- // connected?
- if (!$this->connected()) {
- throw new SMTP_Validate_Email_Exception_No_Connection('Cannot ' .
- 'open a connection to remote host (' . $this->host . ')');
- }
- $result = stream_set_timeout($this->socket, $this->connect_timeout);
- if (!$result) {
- throw new SMTP_Validate_Email_Exception_No_Timeout('Cannot set timeout');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement