/* Sends an SMTP command and provides the server response.  */
static void smtpSendRecv(long socket, char *cmd, char *cmdparam, char *respBuf)
/* Sends an SMTP command and provides the server response.  */
static void smtpSendRecv(long socket, char *cmd, char *cmdparam, char *respBuf)
{
	uint16_t sendLen = 0;
	memset(gcSendRecvBuffer, 0, sizeof(gcSendRecvBuffer));
	if (cmd != NULL) {
		sendLen = strlen(cmd);
		memcpy(gcSendRecvBuffer, cmd, strlen(cmd));
	}
	if (cmdparam != NULL) {
		memcpy(&gcSendRecvBuffer[sendLen], cmdparam, strlen(cmdparam));
		sendLen += strlen(cmdparam);
	}
	memcpy(&gcSendRecvBuffer[sendLen], cSmtpCrlf, strlen(cSmtpCrlf));
	sendLen += strlen(cSmtpCrlf);
	send(socket, gcSendRecvBuffer, sendLen, 0);
	if (respBuf != NULL) {
		memset(respBuf, 0, MAIN_SMTP_BUF_LEN);
		recv(socket, respBuf, MAIN_SMTP_BUF_LEN, 0);
	}
}