else
{
print("Mail could not be sent to $mailTo.");
}
?>
integer pfsockopen(string hostname, integer port, integer
error_number, string error_description, double timeout)
The pfsockopen function operates identically to fsockopen, except that connections are
cached. Connections opened with pfsockopen are not closed when a script terminates.
They persist with the server process.
boolean set_socket_blocking(integer file_descriptor, boolean
mode)
The set_socket_blocking function sets whether a file stream is blocking. In
nonblocking mode, calls to functions that get information from the stream will return
immediately with whatever data are in the input buffer. Blocking mode forces execution
to halt until sufficient data are received.
FTP
The functions in this section allow you to make connections to FTP servers. FTP is the
file transfer protocol. While the file functions allow you to open and manipulate remote
files by specifying a URL instead of a local path, these functions operate directly with the
FTP protocol. They offer a greater degree of control. They also allow you to get a list of
files on the server. The FTP functions were added to PHP by Andrew Skalski.M.
boolean ftp_cdup(integer link)
The ftp_cdup function changes the working directory to the parent directory.
boolean ftp_chdir(integer link, string directory)
The ftp_chdir function moves the working directory to the specified directory.
integer ftp_connect(string host, integer port)
Use ftp_connect to begin an FTP connection. The port argument is optional. An FTP
resource identifier will be returned if the connection is successful, FALSE otherwise. This
ID is used in the rest of the FTP commands. Remem- ber that once you connect, you
must log in before you can issue any commands.