Navigation

Search

server_parse

Description

Sends the specified message to the server, and checks for the expected response. (used by smtp_mail).

Syntax

bool server_parse (string $message, int $socket, int $response)



Parameter $message

Expected type: String
Description: The message to send to the server



Parameter $socket

Expected type: Integer
Description: The socket (port) to send the message on



Parameter $response

Expected type: Integer
Description: The expected response code



Return value

Expected type: Boolean
Description: True if it received the expected response code, false otherwise.


Notes

  • Takes the message to send, socket to send on, and the expected response code.
  • Won't work if fgets or fputs are disabled (meaning SMTP won't work either)
  • Returns false if server doesn't respond or response was something other than expected
  • Returns true otherwise
View all versions of this function