|
Key
This line was removed.
This word was removed. This word was added.
This line was added.
|
Changes (35)
View Page History!schema_provide.png|width=600,,height=311!
*Sending mails* {center}
The IN message looks like :
{code:lang=xml}
{code:lang=xml}
<ns0:mail xmlns:ns0="http://petals.ow2.org/components/mail/version-3.0">
<ns0:host>localhost</ns0:host>
<ns0:port>25</ns0:port>
<ns0:user>user</ns0:user>
<ns0:password>pwd</ns0:password>
<ns0:scheme>smtp</ns0:scheme>
<ns0:from>from@from.com</ns0:from>
<ns0:reply>reply@reply.com</ns0:reply>
<ns0:to>to@to.com</ns0:to>
<ns0:subject>subject</ns0:subject>
<ns0:helohost>helo</ns0:helohost>
<ns0:send-mode>content-and-attachments</ns0:send-mode>
<ns0:content-type>text/plain</ns0:content-type>
<ns0:body>My email content</ns0:body>
<ns0:port>25</ns0:port>
<ns0:user>user</ns0:user>
<ns0:password>pwd</ns0:password>
<ns0:scheme>smtp</ns0:scheme>
<ns0:from>from@from.com</ns0:from>
<ns0:reply>reply@reply.com</ns0:reply>
<ns0:to>to@to.com</ns0:to>
<ns0:subject>subject</ns0:subject>
<ns0:helohost>helo</ns0:helohost>
<ns0:send-mode>content-and-attachments</ns0:send-mode>
<ns0:content-type>text/plain</ns0:content-type>
<ns0:body>My email content</ns0:body>
xmlns:ns0="http://petals.ow2.org/components/mail/generic/version-3"
xmlns:ns1="http://petals.ow2.org/components/mail/version-3">
<ns1:host>localhost</ns1:host>
<ns1:port>25</ns1:port>
<ns1:user>user</ns1:user>
<ns1:password>pwd</ns1:password>
<ns1:scheme>smtp</ns1:scheme>
<ns1:from>from@from.com</ns1:from>
<ns1:reply>reply@reply.com</ns1:reply>
<ns1:to>to@to.com</ns1:to>
<ns1:cc>cc@cc.com</ns1:cc>
<ns1:bcc>bcc@bcc.com</ns1:bcc>
<ns1:subject>subject</ns1:subject>
<ns1:helohost>helo</ns1:helohost>
<ns1:send-mode>content-and-attachments</ns1:send-mode>
<ns1:content-type>text/plain</ns1:content-type>
<ns1:body>My email content</ns1:body>
xmlns:ns1="http://petals.ow2.org/components/mail/version-3">
<ns1:host>localhost</ns1:host>
<ns1:port>25</ns1:port>
<ns1:user>user</ns1:user>
<ns1:password>pwd</ns1:password>
<ns1:scheme>smtp</ns1:scheme>
<ns1:from>from@from.com</ns1:from>
<ns1:reply>reply@reply.com</ns1:reply>
<ns1:to>to@to.com</ns1:to>
<ns1:cc>cc@cc.com</ns1:cc>
<ns1:bcc>bcc@bcc.com</ns1:bcc>
<ns1:subject>subject</ns1:subject>
<ns1:helohost>helo</ns1:helohost>
<ns1:send-mode>content-and-attachments</ns1:send-mode>
<ns1:content-type>text/plain</ns1:content-type>
<ns1:body>My email content</ns1:body>
</ns0:mail>
{code}
{code}
The IN message looks like:
{code:lang=xml}
{code:lang=xml}
<?xml version="1.0" encoding="UTF-8"?>
<mail xmlns="http://petals.ow2.org/components/mail/version-3.0">
<mail xmlns="http://petals.ow2.org/components/mail/version-3.0">
<ns0:mail
<body>My Mail Content</body> xmlns:ns0="http://petals.ow2.org/components/mail/generic/version-3"
xmlns:ns1="http://petals.ow2.org/components/mail/version-3">
<ns1:body>My Mail Content</ns1:body>
<ns1:body>My Mail Content</ns1:body>
</ns0:mail>
{code}
{table-plus:columnAttributes=,,style="text-align:center;",style="text-align:center;"}
|| IN Property || Description || Default || Required ||
|| IN Property || Description || Default || Required ||
| \{[http://www.w3.org/2005/08/addressing]}To | email addresses of the recipients 'To' | \- | Yes |
| \{[http://www.w3.org/2005/08/addressing]}Cc | email addresses of the recipients 'Cc' | \- | No |
| \{[http://www.w3.org/2005/08/addressing]}Bcc | email addresses of the recipients 'Bcc' | \- | No |
| \{[http://www.w3.org/2005/08/addressing]}Bcc | email addresses of the recipients 'Bcc' | \- | No |
| \{[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]}ReplyTo | email address for the reply | \- | no |
Once the service unit is deployed, you just have to send message exchange with an IN message as following to send an email:
{code:lang=xml}
{code:lang=xml}
<?xml version="1.0" encoding="UTF-8"?>
<mail xmlns="http://petals.ow2.org/components/mail/version-3.0">
<mail xmlns="http://petals.ow2.org/components/mail/version-3.0">
<ns0:mail
<body>My Mail Content</body> xmlns:ns0="http://petals.ow2.org/components/mail/version-3/intg-itf"
xmlns:ns1="http://petals.ow2.org/components/mail/version-3">
<ns1:body>My Mail Content</ns1:body>
<ns1:body>My Mail Content</ns1:body>
</ns0:mail>
{code}
Example of IN message with CDATA section:
{code:lang=xml}
{code:lang=xml}
<mail xmlns="http://petals.ow2.org/components/mail/version-3.0">
<body><![CDATA[<element>my content</element>]]></body>
<body><![CDATA[<element>my content</element>]]></body>
</mail> <ns0:mail
xmlns:ns0="http://petals.ow2.org/components/mail/version-3/intg-itf"
xmlns:ns1="http://petals.ow2.org/components/mail/version-3">
<ns1:body><![CDATA[<element>my content</element>]]></ns1:body>
</ns0:mail>
xmlns:ns1="http://petals.ow2.org/components/mail/version-3">
<ns1:body><![CDATA[<element>my content</element>]]></ns1:body>
</ns0:mail>
{code}
Example of IN message with escaped illegal XML character:
{code:lang=xml}
Example of IN message with escaped illegal XML character:
{code:lang=xml}
<mail xmlns="http://petals.ow2.org/components/mail/version-3.0">
<ns0:mail
<body><element>my content</element></body> xmlns:ns0="http://petals.ow2.org/components/mail/version-3/intg-itf"
xmlns:ns1="http://petals.ow2.org/components/mail/version-3">
<ns1:body><element>my content</element></ns1:body>
<ns1:body><element>my content</element></ns1:body>
</ns0:mail>
{code}
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jbi="http://java.sun.com/xml/ns/jbi"
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">
xmlns:generatedNs="http://test">
| host | the host used for connection | \- | Yes |
| port | the port used for connection | 25 | No |
| port | the port used for connection | 25 | No |
| to | email address of the recipient | \- | Yes |
| to | email addresses of the recipients 'To' | \- | Yes |
| cc | email addresses of the recipients 'Cc' | \- | No |
| bcc | email addresses of the recipients 'Bcc' | \- | No |
| cc | email addresses of the recipients 'Cc' | \- | No |
| bcc | email addresses of the recipients 'Bcc' | \- | No |
| from | email address of the sender | \- | Yes |
| reply | email address for the reply | \- | No |
| reply | email address for the reply | \- | No |
+ META-INF
- jbi.xml
- jbi.xml
- service.xml service.wsdl
{noformat}
{code}
All annotations are member of namespace '{{http://petals.ow2.org/bc/mail/annotations/1.0}}'. Annotations override content of the SU descriptor. Available annotations are:
|| Name || Description || Required || Default value ||
| subject | Mail subject. To be able to put data extracted from the incoming message, you can use XPath expression placeholders as '$\{<xpath-expression>}' in the content of this annotation. | No | - |
| body | Mail body. To be able to put data extracted from the incoming message, you can use XPath expression placeholders as '$\{<xpath-expression>}' in the content of this annotation. | No | - |
| subject | Mail subject. To be able to put data extracted from the incoming message, you can use XPath expression placeholders as '$\{<xpath-expression>}' in the content of this annotation. | No | - |
| body | Mail body. To be able to put data extracted from the incoming message, you can use XPath expression placeholders as '$\{<xpath-expression>}' in the content of this annotation. | No | - |
| to | Recipient of the mail defined as a XPath expression. Only one recipient is accepted. | Yes | - |
| to | Email addresses of recipients 'To' of the mail, defined as a XPath expression returning a list of XML nodes. The content value of each node must be one email address. | Yes | - |
| cc | Email addresses of recipients 'Cc' of the mail, defined as a XPath expression returning a list of XML nodes. The content value of each node must be one email address. | No | - |
| bcc | Email addresses of recipients 'Bcc' of the mail, defined as a XPath expression returning a list of XML nodes. The content value of each node must be one email address. | No | - |
| cc | Email addresses of recipients 'Cc' of the mail, defined as a XPath expression returning a list of XML nodes. The content value of each node must be one email address. | No | - |
| bcc | Email addresses of recipients 'Bcc' of the mail, defined as a XPath expression returning a list of XML nodes. The content value of each node must be one email address. | No | - |
| options | Use to set options on mail. Options are available as attributes:
* {{dsn-on-delay}}: Enable Delivery Status Notification (DSN) on delay,
* {{dsn-on-delay}}: Enable Delivery Status Notification (DSN) on delay,
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jbi="http://java.sun.com/xml/ns/jbi"
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">
xmlns:generatedNs="http://test">
<mail:from>from email address</mail:from>
<mail:reply>reply email address</mail:reply>
<mail:reply>reply email address</mail:reply>
<mail:to>recipient 'To' addresses</mail:to>
<mail:cc>recipient 'Cc' addresses</mail:cc>
<mail:bcc>recipient 'Bcc' addresses</mail:bcc>
<mail:bcc>recipient 'Bcc' addresses</mail:bcc>
<mail:subject>mail subject</mail:subject>
<mail:send-mode>content-and-attachments</mail:send-mode>
<mail:send-mode>content-and-attachments</mail:send-mode>
* Step 1: An External Consumer Entity (Business Service or simple mail client) sends an email to the registered Mail Store (a classical email account).
* Step 2: Mail Binding Component periodically checks for new mails and imports them.
* Step 3and 4 : Mail Binding Component processes this new mails : transforms them into Message Exchanges, sends them to targeted jbi components (step 4) and finally delete them from the mail Store.