Enterprise Manager logoEnterprise Manager: Email Services

Description

In BBj 17.00 and higher, Email Services, found in BBjServices, is for configuring outgoing Simple Mail Transfer Protocol (SMTP) clients. An email service allows users to send emails from BBj or Java programs using the Admin API or Event Handler notifications.

EM NavigatorBBjServicesEmail Services

Toolbar

Button Function
Configures a new email service.
Removes selected email service(s).
Refreshs the email services list.

Configuring Email Services

The Email Services page enables configuration of outgoing mail servers for BBj or Java programs using the Admin API or Event Handlers notifications. Clicking the button opens configuration fields for server, port, authentication, and credentials. The Send Test Message button launches a dialog for composing and verifying email functionality.

Email Services Settings List

Settings Functionality
Service Name The service name is displayed in the email services list and the Admin API selects a specific email service using this field.
Send Test Message Sends a test email using the configured service, click Send Test Message, enter To, Subject, and Message, choose OK to deliver or Cancel to dismiss.
Server SMTP Server Address: The hostname or IP address of the mail server (e.g., smtp.example.com).
Port

Common ports are 25, 465, and 587. The different ports are usually associated with the authentication types:

  • 25: Typically used without encryption.

  • 465: Typically used with SSL.

  • 587: Typically used with TLS.

User Specifies the username credential required for authenticating with the configured email server during outgoing message transmission.
Password The authentication password required for secure login and connection to the configured SMTP mail server.
Default From The default sender email address automatically used in the "From" field for outgoing messages.
Default Reply-To The default reply email address automatically used in the Reply-To field for outgoing messages.
Authentication

There are three different types, choose the one required by your mail server provider.

  • NONE (not recommended).

  • Transport Layer Security (TLS).
  • Secure Socket Layer (SSL).

Example Configurations

Gmail

  • Server: smtp.gmail.com
  • Port: 465 or 587
  • User: your full Gmail address (e.g., example@gmail.com)
  • Password: your Gmail password
  • Authentication: SSL/TLS

Outlook/Hotmail

  • Server: smtp-mail.outlook.com
  • Port: 587
  • User: your full Outlook.com/Hotmail address (e.g., example@outlook.com)
  • Password: your Outlook.com/Hotmail password
  • Authentication: TLS

Yahoo Mail

  • Server: smtp.mail.yahoo.com
  • Port: 465 or 587
  • User: your full Yahoo email address (e.g., example@yahoo.com)
  • Password: your Yahoo email password
  • Authentication: SSL/TLS

iCloud Mail

  • Server: smtp.mail.me.com
  • Port: 587
  • User: your full iCloud email address (e.g., example@me.com)
  • Password: your iCloud email password
  • Authentication: TLS

Remarks

A user can verify that their Email Service has been configured properly by clicking the [Send Test Message] button to send a message to an email of their choice. If the test fails, the user can adjust the configurations as needed.

Admin API

BBjAdminBase.newEmailService creates a new BBjAdminEmailService object, which is used to configure an email service and send emails using BBjAdminEmailMessage. Alternatively, the user can get a list of email services on the server with BBjAdminBase.getEmailServices or specify an existing email service by its service name with BBjAdminBase.getEmailService.

Admin API Example

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 "Enter recipient (comma separate multiple): "
input recipient$

print "Enter the subject of the message:"
input subject$

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 "***********************"
goto promptForService

See Also

BBjAdminBase

Event Handlers

Processes

Log Files

Configuration History