• Welcome to Simple Machines Community Forum. Please login or sign up.



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


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.


  • 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