sAuth.Format(_T("AUTH LOGIN\r\n"));
m_wsSMTPServer.Send( (LPCTSTR)sAuth, sAuth.GetLength() );
if(!get_response(334))
{ m_wsSMTPServer.Close();
delete response_buf;
response_buf = NULL;
return FALSE;
}//send base64 encoded username
CString temp;
CBase64 coder;

AfxMessageBox("Enter base64");

AfxMessageBox(pszUsername);
temp=coder.Encode(pszUsername,strlen(pszUsername));

AfxMessageBox(temp);
m_wsSMTPServer.Send((LPCTSTR)temp,temp.GetLength());
AfxMessageBox("wait");// 程序能执行到这,但以后就像死机了一样?请问为什么?我写的程序对不对????
if(!get_response(334))
{ m_wsSMTPServer.Close();
delete response_buf;
response_buf = NULL;
return FALSE;
}

//send base64 encode password

temp=coder.Encode(pszPassword,strlen(pszPassword));

m_wsSMTPServer.Send((LPCTSTR)temp,temp.GetLength());
if(!get_response(235))
{ m_wsSMTPServer.Close();
delete response_buf;
response_buf = NULL;
return FALSE;
}
m_bConnected = TRUE;
return TRUE;