Expand | ||||||
---|---|---|---|---|---|---|
| ||||||
|
SMTP Bridge component microservice allows you to connect to a remote email/news server and send emails/news articles.
...
Info |
---|
While sending attachments with the mail, if readFromFile attribute is set to yesenabled, then the content of the tag is treated as the filename and if it is set to nodisabled, then the content of the tag is treated as the content of the attachment with a dummy filename. |
...
Anchor | ||||
---|---|---|---|---|
|
The properties that can be configured in the Managed Connection Factory panel of CPS are explained the sections below.
Figure 1: Managed Connection Factory panel in CPS
Anchor | ||||
---|---|---|---|---|
|
Protocol
Specifies the protocol used to retrieve emails.
- SMTP– Simple Mail Transfer Protocol is used to send emails.
- NNTP– Network News Transfer Protocol is used to transfer news from one network to another.
Connection Configuration
Click the ellipses button to configure the properties.
Figure 2: Connection Configuration properties
MailServer IP/Name
The IP address or name of the SMTP mail server/ NNTP news server. MailServer Port
MailServer Port
The port on which the SMTP server is running on the host specified by the property MailServer IP/Name. Default port for NNTP is 119 and SMTP is 25
Use DefaultSession
The component uses a session (javax.mail.Session) to represent a mail session. A session collects together properties and defaults used by the mail APIs.
If this option is
...
- enabled, the default session object (javax.mail.Session) is used to connect to the mail server. If a default is not setup, a new Session object is created and installed as default.
...
- disabled, the the default session object is not used and a new session object is created for every connection attempt.
Additional Properties
Additional properties which can be used for creating connection can be specified here. For instance, to enable debug in Javamail, set a property 'mail.debug' to 'true'.
Info | ||
---|---|---|
| ||
To send mails from gmail,
|
Tip | ||
---|---|---|
| ||
For the properties which are supported by
|
Anchor | ||||
---|---|---|---|---|
|
Authentication Configuration
Authentication required
Specifies whether the connection has to be authenticated by the SMTP/NNTP server. The properties Login Name and Password for authentication are relevant only if Authentication is required. In case of NNTP, new server authenticates users against their preset account ids and passwords. You needs to provide authentication information in order to post news articles to the news server.
Login Name
The Login Name with which the connection to the SMTP/NNTP server is made. The login name specified must be valid with respect to the server whose URL is specified by
...
the MailServer/NewsServer IP/Name property.
Password for authentication
Password for the user as specified by the
...
Login Name property.
Anchor | ||||
---|---|---|---|---|
|
Connection Timeout for mail server
Socket connection timeout value in milliseconds. This is the
...
duration (in milliseconds) for which the component waits while trying to establish connection with the server. If the component fails to get a valid connection in the specified connection timeout interval, then the retry behavior depends on the configuration specified in Error Configuration Panel. Default value -1 indicates infinite timeout.
Timeout for sending MIME message
Socket I/O timeout value in milliseconds while sending MIME message. If sending a MIME message requires more time, the current connection will be lost. For example, if attaching a file takes more than the specified timeout period, then the connection will be timed out by the component. Default value -1 indicates infinite timeout.
Anchor | ||||
---|---|---|---|---|
|
Enable AS1
...
Select this option to enable AS1 and provide signing, encryption and MDN configuration by clicking the
...
AS1 SSL Configuration property ellipsis button.
Signature Configuration
Figure 23: Signature configuration details
Sign Mail
...
Enable this property to sign mail and provide algorithm and key store details to be used for signing.
Alias
...
Host private key alias should be configured.
Info |
---|
Refer to the SSL Configuration – Client perspective section for configuring keystore and certificate alias details. |
MDN configuration
Figure 34: MDN configuration details
Request Receipt
...
Choose whether MDN should be signed or unsigned.
Encryption Configuration
Figure 45: Encryption configuration details
Encrypt Mail
...
When this option is selected, mail will be encrypted with the provided algorithm and Keystore details.
Anchor | ||||
---|---|---|---|---|
|
Figure 56: Interaction Configurations
Anchor | ||||
---|---|---|---|---|
|
Display Name of the Sender
Name of the Sender to be displayed in the mail that is sent using the component.
If the input message has <From> element, its value overrides the display name specified by this property.
Email ID of the Sender
The sender's e-mail ID. This ID must be valid with respect to the server details provided in the Managed Connection Factory Panel.
...
SMTP component takes the input in XML format as shown below when SMTP protocol is selected.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<?xml version="1.0" encoding="UTF-8"?> <ns1:Email xmlns:ns1="http://www.fiorano.com/fesb/activity/SMTP1/smtp/in"> <To>To</To> <From>From</From> <CC>CC</CC> <BCC>BCC</BCC> <ReplyTo>ReplyTo</ReplyTo> <ReturnReceipt>false</ReturnReceipt> <Subject charset="UTF-8">string</Subject> <Headers> <Header name="name" value="value" charset="UTF-8" /> </Headers> <Attachments> <Attachment name="name" contentId="contentId" readFromFile="no" base64Encoded="no">string</Attachment> </Attachments> <Body charset="UTF-8"> <TextBody>TextBody</TextBody> <HtmlBody>HtmlBody</HtmlBody> </Body> </ns1:Email> |
Figure 11: Input in XML format when SMTP protocol is selectedSMTP component takes the input in XML format as shown below when NNTP protocol is selected.
Code Block | ||
---|---|---|
| ||
<?xml version="1.0" encoding="UTF-8"?> <ns1:Email xmlns:ns1="http://www.fiorano.com/fesb/activity/SMTP1/smtp/in"> <Newsgroup>Newsgroup</Newsgroup> <From>From</From> <Subject charset="UTF-8">string</Subject> <Headers> <Header name="name" value="value" charset="UTF-8" /> </Headers> <Attachments> <Attachment name="name" contentId="contentId" readFromFile="no" base64Encoded="no">string</Attachment> </Attachments> <Body charset="UTF-8"> <TextBody>TextBody</TextBody> <HtmlBody>HtmlBody</HtmlBody> </Body> </ns1:Email> |
Figure 12: Input in XML formatwhen NNTP protocol is selected
Descriptions of the elements involved are as below:
...
If the e-mail is sent successfully, then the component sends an XML output with a single element Result.
Figure 67: Sample response
Anchor | ||||
---|---|---|---|---|
|
...
Configure the SMTP Bridge as described in Configuration and Testing section and use Feeder and Display component to send sample input and check the response respectively.
Figure 78: Sample flow for Scenario 1
...
Code Block | ||||
---|---|---|---|---|
| ||||
<?xml version="1.0" encoding="UTF-8"?> <ns1:SMTP xmlns:ns1="http://www.fiorano.com/fesb/activity/SMTP1/smtp/out"> <ns1:Result>Email sent successfully </ns1:Result> </ns1:SMTP> |
Figure 89: Mail sent by SMTP Bridge in the Inbox
...
In an order entry scenario e-mails can be sent to the concerned party when a PO is accepted or rejected.
Figure 910: Event Process demonstrating
...