The Email sample consists of three message flows:
Creating an email form
Creating an email form requires a simple message flow that consists of the following nodes:
The message flow receives a request from a web browser client by using HTTP transport.
The JavaCompute node is used in the message flow to create an HTML input form. You can enter values for the email, including the message body, the content type of the message, and add attachments. The information submitted from the input form is sent as the response to the request. The following diagram shows the emailform message flow:
Sending an email
You can enter email details to compose an email message complete with the recipient addresses and any attachments. The form is submitted on completion.
Submitting the form posts all the email details to a second message flow that is listening on an HTTP port, by using HTTP.
The second message flow consists of the following nodes:
The message flow receives the email details from the web browser client as a Multipurpose Internet Mail Extensions (MIME) message by using HTTP transport.
A JavaCompute node processes the email details dynamically by overriding the runtime values in the local environment, the email output header, and the message body.
The EmailOutput node is used to send the email.
If the email is sent successfully, a JavaCompute node creates a suitable reply as the message body and changes the content type of the message to text or HTML. The response message is then sent to the web browser client.
If the email was not sent successfully, a different JavaCompute node is used to retrieve the exception. The exception is included in a response message that is sent to the web browser client. This action enables you to view the exception that caused the email to fail to send.
When you click OK, the first message flow is invoked and you can enter the correct details in the email input form.
The following diagram shows the sendemail message flow:
Receiving an email
You can enter the email server address where the emails are to be received from.
If you specify the same server details that you used previously, and you use the
same server account security identity user ID and password pair to authenticate
with the server, the email input node picks up the email that has been sent by
the output message flow.
The third message flow consists of the following nodes:
This message flow is not automatically deployed by the sample. There are two
fields that must be configured in the Email Input node to match your test
environment. Optionally the destination Directory
property on the File Output node can be changed, because the preconfigured
value is not appropriate for a Linux environment.
For more information about configuring the EmailInput node, see
Setting up the Email Input sample.
The message flow receives the email from the email server as a MIME message.
A Filter node processes the email and directs it either to an MQ Header node or to the File Output node based on whether the email has an attachment or not.
If the email does not contain an attachment, the following actions take place:
If the email does contain an attachment, the following actions take place:
The following diagram shows the getemail message flow: