|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.basedb.util.EmailUtil
public class EmailUtil
Utility class for email sending. Before use it must be initialized (this is done automatically when starting BASE). Configuration options in the base.config file are used.
Field Summary | |
---|---|
static Pattern |
EMAIL_REGEXP
This pattern can be used to find email addresses. |
private static boolean |
enabled
|
private static String |
hostName
|
private static int |
hostPort
|
private static boolean |
initialized
|
private static String |
senderEmail
|
private static String |
senderName
|
private static boolean |
ssl
|
private static boolean |
tls
|
Constructor Summary | |
---|---|
EmailUtil()
|
Method Summary | |
---|---|
static org.apache.commons.mail.Email |
createSimpleEmail()
Create a simple text email. |
static void |
init()
|
static boolean |
isEnabled()
Check if email sending has been enabled for the server or not. |
static boolean |
isEnabled(User user)
Check if email sending is enabled for the given user. |
static boolean |
isValidEmail(String email)
Checks if the given string looks like an email address. |
static void |
unload()
Unload all settings. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final Pattern EMAIL_REGEXP
private static boolean initialized
private static boolean enabled
private static String hostName
private static int hostPort
private static boolean ssl
private static boolean tls
private static String senderEmail
private static String senderName
Constructor Detail |
---|
public EmailUtil()
Method Detail |
---|
public static void init()
public static void unload()
public static boolean isEnabled()
init()
method hasn't been called, the server admin hasn't
specified an outgoing smtp server or an outgoing sender email.
public static boolean isEnabled(User user)
isEnabled()
).
User.getSendMessagesAsEmail()
).
user
- The user to checkpublic static boolean isValidEmail(String email)
EMAIL_REGEXP
pattern.
email
- The string to check
EMAIL_REGEXP
public static org.apache.commons.mail.Email createSimpleEmail() throws org.apache.commons.mail.EmailException
org.apache.commons.mail.EmailException
- If there is something wrong with the setup
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |