Connecting to smtp.live.com with the TcpClient class
I'm trying to connect to smtp.live.com using the TcpClient class. There is a wonderful example of connecting to Gmail here: Testing SMTP server is running via C# Unfortunately, when updating this to work with smtp.live.com, I'm getting an "IOException: The handshake failed due to an unexpected packet format" when the AuthenticateAsClient method is called. How can I work around this? class Program { static void Main(string[] args) { using (var client = new TcpClient()) { var server = "smtp.live.com"; var port = 25; client.Connect(server, port); using (var stream = client.GetStream()) using (var