Before you run the Email Output or Email Input parts of the sample, you
must provide the required information in the email form, such as
the email server URL.
The Email Output part of the sample contains two message flows:
The emailform message flow: This message flow creates the email form that you
must complete with the information about the email that you want to send.
The sendemail message flow: This message flow processes the information
submitted from the email form and uses this information to send an email
message.
When you have deployed these message flows, there is no further configuration
required to run the sample. Use a web browser client to complete the email form that
is used in this sample.
Launch a web browser client. In the URL request
field type http://localhost:7080/hello. The email
input form displays in the web browser.
Enter the details of the Simple Mail Transfer Protocol (SMTP) server. For example,
SMTP.my.company.com, then use the form as an email
client. Ensure that the To and
From fields contain valid email addresses.
Complete the required and optional fields of the email form.
To send the email message with any attachments, click
Submit. If sending the email failed, details of
the exception are displayed in the web browser. If the email is sent
successfully, a confirmation message with the message identification is
displayed in the web browser.
If sending the email failed, click OK to display
an empty email form. Complete the email form with the correct information and
try sending the message again.
The Email Input sample adds the following third message flow:
The getemail message flow: This message flow processes the email that is sent by the
Email Output node, and filters the email either to a WebSphere MQ queue, or saves the attachment
to a file by using the File Output node.
Prerequisite: Before running the Email Input part of the sample, ensure that you have
completed the steps that are described in
Setting up the Email Input sample.
When you have deployed the getemail message flow, use a web browser client to
complete the email form that is used in this sample.
Launch a web browser client. In the URL request
field type http://localhost:7080/hello. The email input
form displays in the web browser.
Enter the details of the SMTP server. For example,
SMTP.my.company.com, then use the form as an email client.
Ensure that the To and
From fields contain valid email addresses.
Complete the required fields of the email form, add a subject, and some message
body text.
Click Submit. If sending the email failed, details of the
exception are displayed in the web browser. If the email is sent successfully, a
confirmation message with the message identification is displayed in the web browser.
If sending the email failed, click OK to display an empty
email form. Complete the email form with the correct information and try sending the
message again.
After the email poll interval, which is 5 seconds by default, the email text can be
viewed on the WebSphere MQ queue EMAILOUT.
Try sending an email with an attachment:
Return to the email sending form in the web browser.
Complete the required fields of the email form, add a subject, and some message
body text.
Click Choose File and select a file to be sent as
an attachment.
Select the correct Attachment Content Type from
the menu to match the file type of the selected attachment. For example, for a
.jpg image file, select
application/octet-stream.
Click Submit. If sending the email failed, details
of the exception displays in the web browser. If the email is sent successfully, a
confirmation message with the message identification displays in the web browser.
If sending the email failed, click OK to display
an empty email form. Complete the email form with the correct information and try
sending the message again.
After the email poll interval, which has a default of 5 seconds, the email
attachment is saved to a file named
email_attachment.dat, which has a default location of
c:\temp\. Replace the extension name of the saved attachment
file with the extension of the original file and view the contents.