I almost used the same technology as you, however I used my application to connect Exchange Server through the Office 365 platform on WinForms. I, too, had the same problem as you, but was achieved using code that has a slight modification to what others gave above.
SmtpClient client = new SmtpClient(exchangeServer, 587); client.Credentials = new System.Net.NetworkCredential(username, password); client.EnableSsl = true; client.Send(msg);
I had to use port 587, which, of course, is the default port for TSL, as well as authentication.
hiFI Feb 05 '13 at 12:36
source share