using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
smtpClient.EnableSsl = true;
ServicePointManager.ServerCertificateValidationCallback = delegate(object s, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) { return true; };