Is there any method to check if the email address is valid in Java? Or is it possible to implement it in code?
validation email java apache-commons
It is easy to use the java email package.
public static boolean isValidEmailAddress(String email) {
boolean result = true;
try {
InternetAddress emailAddr = new InternetAddress(email);
emailAddr.validate();
} } catch (AddressException ex) {
result = false;
}
return result;
}
© 2024 OneMinuteCode. All rights reserved.