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

<to>

Specifies one or more address nodes, each containing the email address of a primary recipient

You must provide at least one address.

Yes

<cc>

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 recipientNo

<subject>

Specifies the subject line for the email message

Yes

<from>

Specifies the email address of the message sender

Yes

<body>

Specifies the body text for the email message

Yes

<attachments>

Contains the <attachment> elements

Conditional; required if the <attachment> element is present

<attachment>

Specifies the full path and file name of the file to be attached to the mail message

You can define one or more <attachment> elements. The file to be attached must reside on the peer executing the adapter request.

No

<character-set>

Specifies the supporting CharSet

Also called character set, it includes identifiers describing a series of universal characters.

Default value: UTF-8

No

<content-type>

Specifies the content type of the message body

Valid values: text/plain, text/html, text/xml

Notes

  • The <content-type> element must not contain the charset parameter.

    Correct example:
    <content-type> text/plain <\content-type>
    Incorrect example:
    <content-type> text/html;charset=utf-8 <\content-type>
  • If you do not specify a <content-type> element in the adapter request, the <content-type> specified when configuring the adapter is used.

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 BMC Atrium Orchestrator 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 BMC Atrium Orchestrator 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

<metadata>

Contains the <status> elements

<status>

Indicates the status of the adapter request

Valid values: success, error

<error>

Specifies the error message returned when the value of the <status> element is error

 

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>
Was this page helpful? Yes No Submitting... Thank you

Comments