title: Error 997 (ERROR_IO_PENDING) from CSMTPConnection::SendSimple ("Overlapped I/O operation in progress"
body: <p>CSMTPConnection is an ATL (VC++) class in atlsmtpconnection.h.
  Code:</p>
  
  <pre><code>static _TCHAR mailserver[ 256 ];
  static _TCHAR mailsender[ 256 ];
  static _TCHAR mailrecips[ 256 ];
  static _TCHAR subject[ 256 ];
  static _TCHAR msg[ 256 ];
  static DWORD mailtimeout=10000;
  static CSMTPConnection con;
  ...
  if (con.Connect( mailserver, mailtimeout )){
    if (con.SendSimple( mailrecips, mailsender, subject, msg)) {
      // it worked
    } else {
      // it failed
    }
  } else {
    // it failed
  }
  </code></pre>
  
  <p>Built with VS2005.
  Deployed in a service on a mixture of Windows 2008 and Windows 2003 servers (about 10).
  Works everywhere except on ONE of the windows 2003 servers, where the SendSimple method (or it might be the Connect) ALWAYS produces error 997 - Overlapped I/O operation in progress.
  I suppose I could just keep calling SendSimple in a loop till I don't get the error, but will that work?</p>