Email validation s被认为是最好的工具(),但我只是尝试了一下,它也无法接受评论。 InternetAddress emailAddr = new InternetAddress(email); emailAddr.validate(); pers

Email validation s被认为是最好的工具(),但我只是尝试了一下,它也无法接受评论。 InternetAddress emailAddr = new InternetAddress(email); emailAddr.validate(); pers,email-validation,jakarta-mail,rfc822,rfc2822,Email Validation,Jakarta Mail,Rfc822,Rfc2822,s被认为是最好的工具(),但我只是尝试了一下,它也无法接受评论。 InternetAddress emailAddr = new InternetAddress(email); emailAddr.validate(); person@registry.organization user@host.network /** * minimum email l@n.co * */ public sta

s被认为是最好的工具(),但我只是尝试了一下,它也无法接受评论。
InternetAddress emailAddr = new InternetAddress(email);
emailAddr.validate();
            person@registry.organization
                 user@host.network
    /**
     * minimum email l@n.co
     * */
    public static boolean checkEmail(final String emlId, int dbgPrint) {
        // ex:ak@bv.gh
        if (emlId == null){
            return false;
        }
        final int lngth = emlId.length();
        if (lngth < 6) {
            if (dbgPrint > 1) {
                System.out.println(" lngth < 6");
            }
            return false;
        }
        final int locationAt = emlId.indexOf('@');
        if (locationAt < 1) {
            if (dbgPrint > 1) {
                System.out.println("locationAt < 1 : " + locationAt);
            }
            return false;//
        }
        final int postLastPeriod = emlId.lastIndexOf('.');
        if (postLastPeriod < 0) {
            if (dbgPrint > 1) {
                System.out.println("postLastPeriod < 0, locationAt " + locationAt);
            }
            return false;
        }
        if (dbgPrint > 1) {
            System.out.println(" locationAt " + locationAt + ", postLastPeriod :" + postLastPeriod + " lngth " + lngth);
        }
        if (lngth - postLastPeriod < 3) {
            if (dbgPrint > 1) {
                System.out.println(" lngth - postLastPeriod < 2");
            }
            return false;
        }
        if (postLastPeriod - locationAt < 1) {
            if (dbgPrint > 1) {
                System.out.println(" postLastPeriod - locationAt < 1");
            }
            return false;
        }
        return true;

    }