public interface BBjAdminEmailService extends BBjAdminCommitPropertyWriter
Contains all the configuration information for an email service. An email service allows users to send email from a BBj or Java programs using the Admin API, or Event Handler notifications. The service contains all the information necessary to send messages through an outgoing mail server.
The following sample code requests a list of all Email Services configured on the local BBjServices installation. It then displays this list for the user to select a service and then prompts for email message information to send a test sending a simple message.
use com.basis.api.admin.BBjAdminEmailService
use com.basis.api.admin.BBjAdminEmailMessage
declare BBjAdminBase api!
declare BBjAdminList emailServices!
declare BBjAdminEmailService emailSvc!
declare BBjAdminEmailService selectedEmailSvc!
declare BBjAdminEmailMessage msg!
api! = BBjAdminFactory.getBBjAdmin("admin", "admin123")
promptForService:
emailServices! = api!.getEmailServices()
print "Select a service to use to send a message:"
for i = 1 to emailServices!.size()
emailSvc! = cast(BBjAdminEmailService, emailServices!.get(i - 1))
print str(i) + ") " + emailSvc!.getString(BBjAdminEmailService.NAME)
next i
input "Enter Choice #: ", choice
selectedEmailSvc! = cast(BBjAdminEmailService, emailServices!.get(choice - 1))
print
print "Enter recipient (comma separate multiple): "
input recipient$
print
print "Enter the subject of the message:"
input subject$
print
print "Enter short message: "
input message$
msg! = selectedEmailSvc!.createMessage()
msg!.setString(BBjAdminEmailMessage.TO, recipient$)
msg!.setString(BBjAdminEmailMessage.SUBJECT, subject$)
msg!.setString(BBjAdminEmailMessage.TEXT, message$)
selectedEmailSvc!.sendMessage(msg!)
print "Your message was successfully sent!"
print "***********************"
print
goto promptForService
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
AUTH |
static java.lang.String |
AUTH_NONE |
static java.lang.String |
AUTH_SSL |
static java.lang.String |
AUTH_TLS |
static java.lang.String |
DEFAULT_FROM |
static java.lang.String |
DEFAULT_REPLY_TO |
static java.lang.String |
ID |
static java.lang.String |
NAME |
static java.lang.String |
PASSWORD |
static java.lang.String |
PORT |
static java.lang.String |
SERVER |
static java.lang.String |
USER |
Modifier and Type | Method and Description |
---|---|
BBjAdminEmailMessage |
createMessage() |
BBjAdminList<BBjAdminProperty> |
getDescriptiveProperties()
Used primarily by GUI applications like the Enterprise Manager to dynamically generate
an admin UI.
|
void |
sendMessage(BBjAdminEmailMessage p_message) |
void |
setDescriptiveProperties(BBjAdminList<BBjAdminProperty> p_descriptiveProps)
Used primarily by GUI applications like the Enterprise Manager to dynamically generate
an admin UI.
|
getChangedProperties, getClearedProperties, getOriginalProperties
addType, canAddNewProperties, canClear, clear, clearProperties, clearProperty, getReadOnly, hasChanged, isReadOnly, setBoolean, setDouble, setInt, setList, setLong, setProperties, setString, setValue
checkValueEqual, contains, contains, getBoolean, getDouble, getInt, getList, getLong, getProperties, getString, getType, getTypes, getValue
commit, rollback
static final java.lang.String ID
static final java.lang.String NAME
static final java.lang.String SERVER
static final java.lang.String PORT
static final java.lang.String USER
static final java.lang.String PASSWORD
static final java.lang.String AUTH
static final java.lang.String DEFAULT_FROM
static final java.lang.String DEFAULT_REPLY_TO
static final java.lang.String AUTH_SSL
static final java.lang.String AUTH_NONE
static final java.lang.String AUTH_TLS
BBjAdminEmailMessage createMessage() throws BBjAdminException
BBjAdminException
void sendMessage(BBjAdminEmailMessage p_message) throws BBjAdminException
BBjAdminException
BBjAdminList<BBjAdminProperty> getDescriptiveProperties() throws BBjAdminException
BBjAdminException
void setDescriptiveProperties(BBjAdminList<BBjAdminProperty> p_descriptiveProps) throws BBjAdminException
BBjAdminException