i've tried to send email using this code..but an error occurred in smtp.Send(mail); messaging "Failure sending mail"
MailMessage mail = new MailMessage();
// set the addresses
mail.From = new MailAddress("from@gmail.com");
mail.To.Add(new MailAddress("to@yahoo.com"));
// set the content
mail.Subject = "test sample";
mail.Body = @"thank you";
SmtpClient smtp = new SmtpClient("smtp.gmail.com");
smtp.Credentials = new NetworkCredential("from@gmail.com", "password");
smtp.Send(mail);