List of usage examples for javax.mail Message isMimeType
public boolean isMimeType(String mimeType) throws MessagingException;
From source file:org.wso2.carbon.registry.es.utils.EmailUtil.java
/** * This method is used to extract verification URL from the e-mail message. * * @param message re-mail message.// w w w . jav a2 s .c o m * @return verification URL to be redirect to. */ private static String getBodyFromMessage(Message message) throws IOException, MessagingException { if (message.isMimeType("text/plain")) { String[] arr = message.getContent().toString().split("\\r?\\n"); for (int x = 0; x <= arr.length; x++) { if (arr[x].contains("https://")) { return arr[x]; } } } return ""; }