當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。