| java.lang.Object net.myvietnam.mvncore.util.MailUtil
MailUtil | final public class MailUtil (Code) | | |
Method Summary | |
public static void | checkGoodEmail(String input) Check if an email is good and safe or not. | public static String | getEmailDomain(String email) Get the domain part of an email. | public static String | getEmailUsername(String email) Get the user name part of an email. | public static String[] | getEmails(String email) | public static String[] | getEmails(String to, String cc, String bcc) | public static MailMessageStruct[] | receiveEmail(String popServer, String popUser, String popPassword) | public static void | sendMail(String from, String to, String cc, String bcc, String subject, String message, boolean sendAsHTML) NOTE: param to, cc, bcc cannot be all empty. | public static void | sendMail(InternetAddress from, String to, String cc, String bcc, String subject, String message, boolean sendAsHTML) | public static void | sendMail(MailMessageStruct mailItem) | public static void | sendMail(Collection mailStructCollection) |
MAX_MESSAGES_PER_TRANSPORT | final public static int MAX_MESSAGES_PER_TRANSPORT(Code) | | |
checkGoodEmail | public static void checkGoodEmail(String input) throws BadInputException(Code) | | Check if an email is good and safe or not.
This method should be use for all email input from user
Parameters: input - String throws: BadInputException - if email is not good |
getEmailDomain | public static String getEmailDomain(String email)(Code) | | Get the domain part of an email. Ex: input: test@yahoo.com => output: yahoo.com
Parameters: email - String the email String the user name part of an email |
getEmailUsername | public static String getEmailUsername(String email)(Code) | | Get the user name part of an email. Ex: input: test@yahoo.com => output: test
Parameters: email - String the email String the user name part of an email |
getEmails | public static String[] getEmails(String email) throws BadInputException(Code) | | This method trim the email variable, so if it contains only spaces,
then it will be empty string, then we have 0 token :-)
The returned value is never null
|
sendMail | public static void sendMail(String from, String to, String cc, String bcc, String subject, String message, boolean sendAsHTML) throws MessagingException, BadInputException, UnsupportedEncodingException(Code) | | NOTE: param to, cc, bcc cannot be all empty. At least one must have a valid value
Parameters: from - : must be a valid email. However, if this param is null,then the default mail in config file will be use Parameters: to - : can be null Parameters: cc - : can be null bcc: can be null Parameters: subject - Parameters: message - throws: MessagingException - throws: BadInputException - |
|
|