Thanks fo the links Mike. I think I've got it sorted now.

The CSMTPConnection class uses the CSocketAddr class which uses the function GetAddrInfo, which is not supported on Windows2000 (only XP/2003).

The version of platform SDK I was using incorrectly provides linkage to this function even when the target OS is 2000. When I installed the Platform SDK for 2003 the project fails to build for 2000.

I then had to include the following lines before the atl headers:
#include <winsock2.h>
#include <ws2tcpip.h>
#include <wspiapi.h>

#define GetAddrInfo WspiapiGetAddrInfo
#define FreeAddrInfo WspiapiFreeAddrInfo

This allows the use of getaddrinfo emulation function that apparently works on 2000, although I haven't tested this yet.