Adapter request and response for the SMTP adapter
The SMTP adapter does not use an action. BMC recommends that you do not include unused elements in the adapter request because they might cause errors. When you use a context item as an input for an adapter request, you must enclose the adapter request in the <request-data>
elements. However, when you create a static request, <request-data>
is not required and the adapter request starts with the <smtp-request>
element.
The following table describes the elements of the SMTP adapter request.
Elements of the SMTP adapter request
Element | Description | Required |
---|---|---|
| Specifies one or more address nodes, each containing the email address of a primary recipient | Yes |
| Specifies one or more address nodes, each containing the email address of a courtesy copy recipient | No |
<bcc> | Specifies one or more address nodes, each containing the email address of a blind carbon copy recipient | No |
| Specifies the subject line for the email message | Yes |
| Specifies the email address of the message sender | Yes |
| Specifies the body text for the email message | Yes |
| Contains the | Conditional; required if the |
| Specifies the full path and file name of the file to be attached to the mail message | No |
| Specifies the supporting CharSet | No |
| Specifies the content type of the message body Valid values: text/plain, text/html, text/xml Notes
| No |
The following figure shows an XML template of the adapter request for the SMTP adapter.
XML template of the SMTP adapter request
<smtp-request>
<to>
<address></address>
</to>
<cc>
<address></address>
</cc>
<bcc>
<address></address>
</bcc>
<subject></subject>
<from></from>
<body></body>
<attachments>
<attachment></attachment>
</attachments>
<character-set></character-set>
</smtp-request>
The following figure shows an XML sample of the adapter request for the SMTP adapter. Use the adapter request XML when you create a custom process by using the Call Adapter activity in TrueSight Orchestration Development Studio.
XML sample of the SMTP adapter request
<smtp-request>
<to>
<address>user1@runbox.com</address>
</to>
<cc>
<address>user2@runbox.com</address>
</cc>
<bcc>
<address>mail_test3@bmc.com</address>
</bcc>
<subject>Automation Subject Line</subject>
<from>AutomationAdmin@bmc.com</from>
<body>Message body</body>
<character-set>UTF-8</character-set>
</smtp-request>
The following figure shows an XML sample of the adapter request for the SMTP adapter with attachment support. Use the adapter request XML when you create a custom process by using the Call Adapter activity in TrueSight Orchestration Development Studio.
XML sample of the SMTP adapter request with attachment support
<smtp-request>
<to>
<address>aa@runbox.com</address>
</to>
<subject>New Testing Testing</subject>
<from>bbb@gic.com</from>
<body>New Message body</body>
<attachments>
<attachment>C:\testFile1.txt</attachment>
<attachment>C:\testFile2.txt</attachment>
</attachments>
</smtp-request>
The following figure shows an XML sample of the adapter request when the adapter supports HTML content in an email message.
XML sample of the SMTP adapter request when the adapter supports HTML content in an email message
<smtpRequest>
<from><![CDATA[user1@example.com]]></from>
<to>
<address><![CDATA[user2@example.com]]></address>
</to>
<subject>Test HTML</subject>
<body><![CDATA[<p><h1>An Example BAO Email via HTML</h1><ul><li>Simple HTML List</li><li>With Two Entries</li></ul><a href="http://www.bmc.com/"><img src="http://media.cms.bmc.com/designimages/brand_driver_8.png" alt="Business runs on IT. IT runs on BMC Software." title="Business runs on IT. IT runs on BMC Software." border="0" /></a></p>]]></body>
<character-set />
<content-type>text/html</content-type>
</smtpRequest>
The following figure shows an XML sample of the adapter request when the adapter supports Internet Protocol version 6 (IPv6).
XML sample of the SMTP adapter request when the adapter supports IPv6
<smtp-request>
<to>
<address>devteam@abcd.efg.com</address>
</to>
<cc>
<address>qateam@abcd.efg.com</address>
</cc>
<subject>Testing SMTP </subject>
<from>devteam@abcd.efg.com</from>
<body>testing smtp adapter for IPv6</body>
<character-set>UTF-8</character-set>
</smtp-request>
The SMTP adapter request returns a response that indicates the status of the request. The following table describes the elements of an SMTP adapter response.
Elements of an SMTP adapter response
Element | Description |
---|---|
| Contains the |
| Indicates the status of the adapter request |
| Specifies the error message returned when the value of the |
The following figure illustrates an XML sample of the adapter response for the SMTP adapter.
XML sample of the SMTP adapter response
<smtp-response>
<metadata>
<status>success or error</status>
<error>error message returned, present only with a status of 'error'</error>
</metadata>
</smtp-response>
The following figure shows an XML sample of the adapter response when the adapter supports Internet Protocol version 6 (IPv6).
XML sample of the SMTP adapter response when the adapter supports IPv6
<smtp-response>
<metadata>
<status>success</status>
</metadata>
</smtp-response>
Comments
Log in or register to comment.