public static boolean isValidEmail(Object value){
  InternetAddress addr=parseEmail(value);
  if (addr != null) {
    String address=addr.getAddress();
    if (address.contains(".."))     return false;
    int pos=address.indexOf('@');
    if (pos < 1 || pos == address.length() - 1)     return false;
    String local=address.substring(0,pos);
    String domain=address.substring(pos + 1);
    if (domain.charAt(0) == '.' || local.charAt(0) == '.' || local.charAt(local.length() - 1) == '.')     return false;
    pos=domain.lastIndexOf('.');
    if (pos > 0 && pos < domain.length() - 2) {
      if (StringUtil.isAllAlpha(domain.substring(pos + 1)))       return true;
      try {
        addr.validate();
        return true;
      }
 catch (      AddressException e) {
      }
    }
  }
  return false;
}

public static boolean isValidEmail ( Object value ) { InternetAddress addr = parseEmail ( value ) ; if ( addr != null ) { String address = addr . getAddress ( ) ; if ( address . contains ( ".." ) ) return false ; int pos = address . indexOf ( '@' ) ; if ( pos < 1 || pos == address . length ( ) - 1 ) return false ; String local = address . substring ( 0 , pos ) ; String domain = address . substring ( pos + 1 ) ; if ( domain . charAt ( 0 ) == '.' || local . charAt ( 0 ) == '.' || local . charAt ( local . length ( ) - 1 ) == '.' ) return false ; pos = domain . lastIndexOf ( '.' ) ; if ( pos > 0 && pos < domain . length ( ) - 2 ) { if ( StringUtil . isAllAlpha ( domain . substring ( pos + 1 ) ) ) return true ; try { addr . validate ( ) ; return true ; } catch ( AddressException e ) { } } } return false ; }
returns true if the passed value is a in valid email address format
