Windows CE 
Author Message
 Windows CE

I'm using Windows CE Desktop Handheld PC Emulation to test my Windows CE MFC
application.
I write a email program,use the follow code:

in header file

...
#include <Wcesock.h>
...
CCeSocket m_wsSMTPServer;
...

in source file

BOOL CSMTP::Connect()
{
 CString sHello;
 TCHAR local_host[80];
 if( m_bConnected )
  return TRUE;

 if( !m_wsSMTPServer.Create() )
 {
  m_sError = _T( "Unable to create the socket." );
  return FALSE;
 }
 if( !m_wsSMTPServer.Connect( GetServerHostName(), GetPort()))
 {
  m_sError = _T( "Unable to connect to server" );
  m_wsSMTPServer.Close();
  return FALSE;
 }
 if( !get_response( CONNECT_SUCCESS ) )
 {
  m_sError = _T( "Server didn't respond." );
  m_wsSMTPServer.Close();
  return FALSE;
 }
 gethostname((char*)local_host, 80 );
 sHello.Format( _T("HELO %s\r\n"), local_host );
 m_wsSMTPServer.Send( (LPCTSTR)sHello, sHello.GetLength() );
 if( !get_response( GENERIC_SUCCESS ) )
 {
  m_wsSMTPServer.Close();
  return FALSE;
 }
 m_bConnected = TRUE;
 return TRUE;

Quote:
}

There is a email server running on the same machine. when i run the code,
it always return "Server didn't respond."
the same code(use Csocket) run on Win32 correctly,What's the matter?
Thanks.


Tue, 04 Dec 2001 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Windows CE and Windows XP Communication...

2. Windows CE & /Windows directory

3. Windows CE Online Chat - AMD & bSquare, Designing a High-Performance, Low-Power Windows CE .NET Device - May 15th 12:00 PST (20:00GMT)

4. HP1910 Windows CE Development - Newbie

5. C functions equivalents in Windows CE

6. Windows CE

7. Visual C++ for Windows CE - UK distributors please

8. Windows CE help

9. Windows CE URLMON.DLL First-chance exception

10. Web browser control using ATL in windows CE

11. ATL, Windows CE, and Apartments

12. Windows CE, ATL, and Interprocess Communication

 

 
Powered by phpBB® Forum Software