title: smtp exception “failure sending mail”
body: <p>I created console application for sending Email</p>
  
  <pre><code>    public static void sendEmail(string email, string body)
      {
          if (String.IsNullOrEmpty(email))
              return;
          try
          {
              MailMessage mail = new MailMessage();
              mail.To.Add(email);
              mail.From = new MailAddress("test@gmail.com");
              mail.Subject = "sub";
  
              mail.Body = body;
  
              mail.IsBodyHtml = true;
              SmtpClient smtp = new SmtpClient();
              smtp.Host = "smtp.gmail.com"; //Or Your SMTP Server Address
              smtp.Credentials = new System.Net.NetworkCredential("test@gmail.com", "admin@1234"); // ***use valid credentials***
              smtp.Port = 587;
  
              //Or your Smtp Email ID and Password
              smtp.EnableSsl = true;
              smtp.Send(mail);
          }
          catch (Exception ex)
          {
  
          }
      }
  </code></pre>
  
  <p>I am using correct credential of my gmail account.</p>
  
  <p>Is there any <strong>settings</strong> I need to do for <strong>GMail Account</strong>?</p>