当前位置: 首页>>代码示例>>Java>>正文


Java InternetAddress.validate方法代码示例

本文整理汇总了Java中javax.mail.internet.InternetAddress.validate方法的典型用法代码示例。如果您正苦于以下问题:Java InternetAddress.validate方法的具体用法?Java InternetAddress.validate怎么用?Java InternetAddress.validate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.mail.internet.InternetAddress的用法示例。


在下文中一共展示了InternetAddress.validate方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: validateEmailStandard

import javax.mail.internet.InternetAddress; //导入方法依赖的package包/类
public static String validateEmailStandard(String email){
	try{
		InternetAddress testEmail = new InternetAddress(email);
		testEmail.validate();
		return email + " is a valid email address";
	}catch(AddressException e){
		return email + " is not a valid email address";
	}
}
 
开发者ID:PacktPublishing,项目名称:Machine-Learning-End-to-Endguide-for-Java-developers,代码行数:10,代码来源:ValidatingData.java

示例2: isValidEmailAddress

import javax.mail.internet.InternetAddress; //导入方法依赖的package包/类
/**
 * @param email
 * @return true si l'adrese est correcte
 */
public static boolean isValidEmailAddress(String email) {
	boolean result = true;
	try {
		InternetAddress emailAddr = new InternetAddress(email);
		emailAddr.validate();
	} catch (AddressException ex) {
		result = false;
	}
	return result;
}
 
开发者ID:EsupPortail,项目名称:esup-ecandidat,代码行数:15,代码来源:MethodUtils.java

示例3: isValidEmailAddress

import javax.mail.internet.InternetAddress; //导入方法依赖的package包/类
/**
 * Is valid email address boolean.
 *
 * @param email the email
 * @return the boolean
 */
public static boolean isValidEmailAddress(final String email) {
    boolean result = true;
    try {
        InternetAddress emailAddr = new InternetAddress(email);
        emailAddr.validate();
    } catch (AddressException ex) {
        result = false;
    }
    return result;
}
 
开发者ID:mhaddon,项目名称:Sound.je,代码行数:17,代码来源:EmailUtil.java

示例4: isValidEmailAddress

import javax.mail.internet.InternetAddress; //导入方法依赖的package包/类
public static boolean isValidEmailAddress(String email) {
    boolean valid = true;
    try {
        InternetAddress emailAddr = new InternetAddress(email);
        emailAddr.validate();
    } catch (AddressException ex) {
        valid = false;
    }
    return valid;
}
 
开发者ID:Clcanny,项目名称:MicroServiceDemo,代码行数:11,代码来源:AccountController.java

示例5: isValidEmailAddress

import javax.mail.internet.InternetAddress; //导入方法依赖的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;
}
 
开发者ID:CanadianRepublican,项目名称:DDNS_Server,代码行数:11,代码来源:ForgotServlet.java

示例6: isValidEmailAddress

import javax.mail.internet.InternetAddress; //导入方法依赖的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;
}
 
开发者ID:CanadianRepublican,项目名称:DDNS_Server,代码行数:11,代码来源:CreateServlet.java

示例7: isEmail

import javax.mail.internet.InternetAddress; //导入方法依赖的package包/类
public static boolean isEmail(String email) {

    try {

      // Create InternetAddress object and validated the email address.

      InternetAddress internetAddress = new InternetAddress(email);

      internetAddress.validate();


    } catch (Exception e) {

      return false;

    }

    return true;
  }
 
开发者ID:HPI-Information-Systems,项目名称:metanome-algorithms,代码行数:20,代码来源:DataTypes.java

示例8: validateAddress

import javax.mail.internet.InternetAddress; //导入方法依赖的package包/类
/**
 * Validate the given mail address.
 * Called by all of MimeMessageHelper's address setters and adders.
 * <p>Default implementation invokes {@code InternetAddress.validate()},
 * provided that address validation is activated for the helper instance.
 * <p>Note that this method will just work on JavaMail >= 1.3. You can override
 * it for validation on older JavaMail versions or for custom validation.
 * @param address the address to validate
 * @throws AddressException if validation failed
 * @see #isValidateAddresses()
 * @see javax.mail.internet.InternetAddress#validate()
 */
protected void validateAddress(InternetAddress address) throws AddressException {
	if (isValidateAddresses()) {
		address.validate();
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:18,代码来源:MimeMessageHelper.java


注:本文中的javax.mail.internet.InternetAddress.validate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。