title: How to know sending failure mails in c#
body: <pre><code>public bool SendEmailToActivate(string email)
          {
              try
              {
                  MailMessage mail = new MailMessage();
                  SmtpClient SmtpServer = new SmtpClient("smtp.gmail.com");
  
                  mail.From = new MailAddress("mymailid@gmail.com");
                  mail.To.Add("sendingmailid@gmail.com");
                  mail.Subject = "Test Mail";
                  mail.Body = "This is for testing SMTP mail from GMAIL";
  
                  SmtpServer.Port = 587;
                  SmtpServer.Credentials = new System.Net.NetworkCredential("mymailid@gmail.com", "password");
                  SmtpServer.EnableSsl = true;
  
                  SmtpServer.Send(mail);
                  return true;
              }
              catch (Exception ex)
              {
                  return false;
              }
          }
  </code></pre>
  
  <p>how to know the mail is send success to the user or not in c#. ie. if the mail is not send to user then i want the  count of the failure mails.. please help me.</p>