hey guys...this is ma code which i used in ma application.i tried different kind of codes,but i got da same error unfortunately.i'm using my university network,which has restricted proxy sever.So is this because of the proxy server restrictions,if so tell me how to over come this please..thanx
System.Net.Mail.MailMessage mail = new System.Net.Mail.MailMessage();
System.Net.NetworkCredential cred = new System.Net.NetworkCredential("from@gmail.com", "fromPassword");
mail.To.Add("toMail@yahoo.com");
mail.Subject = "subject";
mail.From = new System.Net.Mail.MailAddress("fromMail@gmail.com");
mail.IsBodyHtml = true;
mail.Body = "message";
System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient("smtp.gmail.com");
smtp.UseDefaultCredentials = false;
smtp.EnableSsl = true;
smtp.Credentials = cred;
smtp.Port = 587;
smtp.Send(mail)