title: How to use IF statement in asp.net using C#
body: <p>I am trying to send an email once all these conditions are found to be true but my problem is that it is still sending an email out even if the condition is set to false.  For example, if either var3 or var4 or var5 is “NO” then I don’t want to send email out.  Here is the pseudo code for what I am checking and they all have to be true in order to send the email out:</p>
  
  <pre><code>If(var1 is not blank And var2 is not set to “YES” And (either var3 OR var4 OR var5 are not set to “NO”)
  Then 
  {
  Send_Email();
  }
  </code></pre>
  
  <p>here is my current code:</p>
  
  <pre><code>if var1 != ("&amp;nbsp;") &amp;&amp; var2!= "YES" &amp;&amp; var3!= ("NO") || var4!= ("NO") || var5!= ("NO") ))
  {
  sendEmail();
  }
  </code></pre>