title: how to use gmail account to send mails?
body: <p>I created gmail account to use it to send mails but no any mails (without any exception) sent code snippet:</p>
  
  <p>public static bool SendEmail(string _FromEmail, string _ToEmail, string _Subject, string _EmailBody)
      {</p>
  
  <pre><code>    try
      {
  
  
          SmtpClient smtpClient = new SmtpClient();
          smtpClient.Host = "smtp.gmail.com";
          smtpClient.DeliveryMethod = SmtpDeliveryMethod.PickupDirectoryFromIis;
          smtpClient.Port = 465;
          smtpClient.Credentials = new NetworkCredential("my gmail account", "my password");
          smtpClient.EnableSsl = false;
          smtpClient.UseDefaultCredentials = false;
          MailMessage msg = new MailMessage();
          msg.From = new MailAddress(_FromEmail);
          msg.To.Add(new MailAddress(_ToEmail));
          msg.Subject = _Subject;
          msg.Body = _EmailBody;
          msg.IsBodyHtml = true;
  
          smtpClient.Send(msg);
  
          return true;
      }
      catch (Exception ex)
      {
          if (ex.InnerException != null)
          {
              String str = ex.InnerException.ToString();
  
          }
          return false;
      }
  
  
  
  }
  </code></pre>