Tuesday, May 15, 2012

Gmail SmtpClient exampe





SmtpClient gglClient = new SmtpClient("173.194.67.108", 587);             gglClient.UseDefaultCredentials = false;             gglClient.DeliveryMethod = SmtpDeliveryMethod.Network;             gglClient.Credentials = new NetworkCredential("username@gmail.com", "password");             gglClient.EnableSsl = true;             MailMessage msg = new MailMessage("", email);             msg.Subject = "";             msg.Body = @" ";             msg.IsBodyHtml = false;             msg.BodyEncoding = UTF8Encoding.UTF8;             gglClient.Timeout = 8000;             ServicePointManager.ServerCertificateValidationCallback =                 delegate(object s, X509Certificate certificate, X509Chain chain,                     SslPolicyErrors sslPolicyErrors) { return true; };             gglClient.Send(msg);

No comments:

Post a Comment