。
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;
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;
helo(ehlo)
auth login
username(base64)\r\n
password(base64)
mail from
rcpt to
.........估計base64 後的username is invalid
用telnet 試試username after base64 doesn't fixed "\r\n"[email protected]
temp1 =strcat( temp,"\r\n");
m_wsSMTPServer.Send((LPCTSTR)temp1,temp1.GetLength());