| \{[http://www.w3.org/2005/08/addressing]}From | email address of the sender | \- | Yes |
| \{[http://www.w3.org/2005/08/addressing]}ReplyTo | email address for the reply | \- | no |
| \{[http://www.w3.org/2005/08/addressing]}Action | the subject of the mail | petals-bc-mail | no |
| \{[http://petals.ow2.org/components/mail/version-3]}Host | the host used for connection | \- | Yes |
| \{[http://petals.ow2.org/components/mail/version-3]}Port | the port used for connection | 25 | No |
| \{[http://petals.ow2.org/components/mail/version-3]}User | the username used for authentication | \- | No |
| \{[http://petals.ow2.org/components/mail/version-3]}Password | the password used for authentication. Can be null or empty | \- | No |
| \{[http://petals.ow2.org/components/mail/version-3]}Scheme | the connection protocol (smtp) | smtp | No |
| \{[http://petals.ow2.org/components/mail/version-3]}HeloHost | HELO host for SMTP | \- | No |
| \{[http://petals.ow2.org/components/mail/version-3]}SendMode | Send either the source, the attachments or both of the payload | content-and-attachments | No |
| \{[http://petals.ow2.org/components/mail/version-3]}ContentType | The mail mime type | text/plain | no |
{table-plus}
h2. Static exposition
Petals Mail binding component can be configured by deploying a new service unit to it. The jbi descriptor ( jbi.xml file) of this service unit must contain a provides node describing the link between an internal jbi endpoint and an external email address.
Once a provides node is configured, you can start to send email via the mail binding component. You just have to send message exchange to endpoints activated by service unit deployments (containing jbi.xml with provides node).
The IN message looks like:
{code:lang=xml}
<?xml version="1.0" encoding="UTF-8"?>
<mail><body>My Mail Content</body></mail>
{code}
h3. Configuration
h4. Service Unit descriptor
{code:lang=xml}
<?xml version="1.0" encoding="UTF-8"?>
<!-- JBI descriptor for PEtALS' "petals-bc-mail" (Mail), version 3.0 -->
<jbi:jbi version="1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jbi="http://java.sun.com/xml/ns/jbi"
xmlns:mail="http://petals.ow2.org/components/mail/version-3.0"
xmlns:petalsCDK="http://petals.ow2.org/components/extensions/version-4.0"
xmlns:generatedNs="http://test">
<!-- Import a Service into PEtALS or Expose a PEtALS Service => use a BC. -->
<jbi:services binding-component="true">
<!-- Import a Service into PEtALS => provides a Service. -->
<jbi:provides
interface-name="generatedNs:SendMail"
service-name="generatedNs:SendMailService"
endpoint-name="SendMailServiceEndpoint">
<!-- CDK specific elements -->
<petalsCDK:wsdl>sendMail.wsdl</petalsCDK:wsdl>
<!-- Component specific elements -->
<mail:scheme>smtp</mail:scheme>
<mail:host>smtp.host.com</mail:host>
<mail:port>25</mail:port>
<mail:user>user</mail:user>
<mail:password>password</mail:password>
<mail:from>from email address</mail:from>
<mail:reply>reply email address</mail:reply>
<mail:to>recipient address</mail:to>
<mail:subject>mail subject</mail:subject>
<mail:send-mode>content-and-attachments</mail:send-mode>
<mail:content-type>text/plain</mail:content-type>
</jbi:provides>
</jbi:services>
</jbi:jbi>
{code}
{include:0 CDK SU Provide Configuration}
\\
{center}{*}Configuration of a Service Unit to provide a service (Mail)*{center}
{table-plus:columnAttributes=,,style="text-align:center;",style="text-align:center;"}