I am using latest ATL CSMTPConnection class ======================================== CSMTPConnection conn; if(!conn.Connect(m_bstrServer)) return HRESULT_FROM_WIN32(GetLastError()); if( !conn.SendMessage(msg) ) return HRESULT_FROM_WIN32(GetLastError()); conn.Disconnect(); ========================================== and getting next error in production environment Number : 10038 Description: An operation was attempted on something that is not a socket. but I could not reproduce this error in my testing environment Any idea? Thank you, Volodia.