public final class MailUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static Email |
getPreConfiguredEmail()
Creates a mail using the commons mail API and initializes it
with all mail parameters from the project.properties file.
|
static void |
validateEmailAddress(String address,
String type)
Validates a mail address for correctness.
|
static void |
validateEmailServer(String server)
Validates given server name for emptiness.
|
static void |
validateParameter(String parameter,
String type)
Validates a single parameter of the e-mail settings for emptiness.
|
static void |
validatePop3(String popServer,
String popUser,
String popPwd)
Validates pop3 settings for emptiness (server and user, password can be empty).
|
public static void validateEmailServer(String server) throws EmailException
server - name to validateEmailException - name is emptypublic static void validatePop3(String popServer, String popUser, String popPwd) throws EmailException
popServer - server name to checkpopUser - user name to checkpopPwd - pwd to checkEmailException - server or user or both are emptypublic static void validateParameter(String parameter, String type) throws EmailException
parameter - parameter to checktype - name of parameter type for announcing in exceptionEmailException - parameter was emptypublic static void validateEmailAddress(String address, String type) throws EmailException
address - address to checktype - name of address type for announcing in exceptionEmailException - address was not validpublic static Email getPreConfiguredEmail()
throws EmailException
EmailException - error while email creationCopyright © 2017 SAP SE. All Rights Reserved.