public static boolean isValidWithMXCheck ( @ Nullable final String sEmail ) { // First check without MX if ( ! EmailAddressHelper . isValid ( sEmail ) ) return false ; final String sUnifiedEmail = EmailAddressHelper . getUnifiedEmailAddress ( sEmail ) ; // MX record checking final int i = sUnifiedEmail . indexOf ( ' ' ) ; final String sHostName = sUnifiedEmail . substring ( i + 1 ) ; return _hasMXRecord ( sHostName ) ; }
Checks if a value is a valid e - mail address according to a complex regular expression . Additionally an MX record lookup is performed to see whether this host provides SMTP services .