The mail binding in SwitchYard provides support for consuming and sending mail messages. It supports both sides - service binding for mail consumption and reference for message sending.
The Mail binding is built on top of camel-mail and supports most of options for this endpoint. Please reffer camel documentation for detailed description of them.
Generic options
Following options can be apiled to <binding.mail> definition:
Binding Services with Mail
Supported options are:
Here's an example of what a mail service binding looks like:
<sca:composite name="camel-binding" targetNamespace="urn:switchyard-quickstart:camel-binding:0.1.0">
<sca:service name="GreetingService" promote="GreetingService">
<camel:binding.mail>
<camel:host>localhost</camel:host>
<camel:username>camel</camel:username>
<camel:consume accountType="pop3">
<camel:copyTo>after-processing</camel:copyTo>
</camel:consume>
</camel:binding.mail>
</sca:service>
</sca:composite>
Binding References with Mail
Binding a reference with mail can be used to send outgoing message. The following configuration options are available for binding.mail when binding references:
-
subject
-
from
-
to
-
CC
-
BCC
-
replyTo
<sca:composite name="camel-binding" targetNamespace="urn:switchyard-quickstart:camel-binding:0.1.0">
<sca:reference name="GreetingService" promote="camel-binding/GreetingService" multiplicity="1..1">
<camel:binding.mail>
<camel:host>localhost</camel:host>
<camel:username>camel</camel:username>
<camel:produce>
<camel:subject>Forwarded message</camel:subject>
<camel:from>camel@localhost</camel:from>
<camel:to>rider@camel</camel:to>
</camel:produce>
</camel:binding.mail>
</sca:reference>
</sca:composite>