如何在不使用java发送任何邮件的情况下检查域中是否存在电子邮件ID [英] how to check that the email id exist in domain without sending any mails using java
本文介绍了如何在不使用java发送任何邮件的情况下检查域中是否存在电子邮件ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有什么方法可以验证电子邮件 ID 在域中的位置吗?
Is there any way to verify where the email id exist in domain or not?
我有以下功能:它只检查有效的域,但我需要检查域中的有效电子邮件地址而不发送任何邮件.
I am having the following function: it checks only for valid domain, but i need to check for valid email address in domain without sending any mails.
public boolean isValidEmailAddress(String email) {
boolean result = true;
try {
InternetAddress emailAddr = new InternetAddress(email);
emailAddr.validate();
} catch (AddressException ex) {
result = false;
}
return result;
}
推荐答案
这是一个可以进行多种类型验证的源代码,我已经使用它多年了:
Here is a source code that could do many type of verification, I've been using it for years :
http://www.rgagnon.com/javadetails/java-0452.html
注意:完整验证见页面中的函数isAddressValid().
Note : see the function isAddressValid() in the page for full validation.
这篇关于如何在不使用java发送任何邮件的情况下检查域中是否存在电子邮件ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文