title: Validation of an email in iPhone
body: <p>I implemented the following code. It is accepting any type of mail id's. Example: abc@xyz.com. But I want to accept the perfect mail id's.Example :abc@gmail.com,abc@yahoo.com. Can any one guide how to do this.</p>
  
  <pre><code>- (BOOL) validateEmail: (NSString *) candidate {
      NSString *emailRegex = @"[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}"; 
      NSPredicate *emailTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", emailRegex]; 
  
      return [emailTest evaluateWithObject:candidate];
  }
  </code></pre>
  
  <p>Thanks in advance</p>