Sending an Email from Oracle Service Bus - Part 1
By Chris Tomkins on Dec 12, 2007
Note: This post was first published before Oracle merged with BEA when the Oracle Service Bus product was known as AquaLogic Service Bus, hence the occasional reference to BEA and AquaLogic Service Bus.
The first step is to create an SMTP Server configuration (it is the SMTP server that actually sends the email). To do this, you need to do the following:
- Click on the System Administration link in the left hand navigation in the service bus console
- Click on Create in the Change Center to create a new session in which you can make changes
- Click on Add and enter the details for your SMTP Server, e.g.
- Click Save.
Now we have an SMTP Server configuration we can use multiple times within Oracle Service Bus without entering this information again.
The next step is to create an email business service that uses this SMTP Server configuration:
- Click on the Project Explorer link in the left hand navigation
- Select (or create) the project and folder you want to create the email business service in
- From the Create Resource drop down select Business Service
- Enter a name and description for your business service and ensure you select the Service Type as Messaging Service:
- Click Next
- Select Text as the Request Message Type, leave the Response Message Type as none (sending email is a one-way service) and then click Next.
- On the next screen, select the Protocol as email and set the Endpoint URI to be mailto:<email address you want the service to send email to> and click Add:
- Click Next
- Select your SMTP Server from the drop down list of SMTP Servers available and configure the rest of the settings on this screen appropriately, e.g.
- Click Next, review the summary and then click Save.
- Click Activate to enforce these changes to Oracle Service Bus.
- Enter a description and click Submit.
You have now successfully created an email business service which you can use to send email from Oracle Service Bus. If you click on the bug icon in the Actions column alongside it, you can use the Test Console to prove this service does indeed send an email to the address you specified, with the settings you configured and the payload you specified in the Test Console.
In the second post of this set I will explain how a proxy service can make use of this email business service and some tips for customising the email sent.