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("[email protected]");
mail.To.Add(new MailAddress("[email protected]"));
// set the content
mail.Subject = "test sample";
mail.Body = @"thank you";
SmtpClient smtp = new SmtpClient("smtp.gmail.com");
smtp.Credentials = new NetworkCredential("[email protected]", "password");
smtp.Send(mail);