pfx-smtp:send

Sends an email. Connection to an SMTP server has to be set up using properties described in the component documentation page (pfx-smtps Component).

Properties

You can use same URI properties as in the standard Camel mail component https://camel.apache.org/components/4.0.x/mail-component.html.

Examples

Send Email Using Default Properties

Send an email using content defined in the body and subject defined in a URI parameter. This example will use the default from and to parameters defined in:

integration.route-error-handling.email.mailFrom

integration.route-error-handling.email.mailTo

Respectively:

<route> <from uri="direct:start"/> <setBody> <groovy>'Mail content'</groovy> </setBody> <to uri="pfx-smtps:send?subject=Subject"/> </route>

Send Email with Customized Sender and Recipient

Send an email using content defined in the body and subject defined in a URI parameter. This example overrides the from and to URI parameters:

<route> <from uri="direct:start"/> <setBody> <groovy>'Mail content'</groovy> </setBody> <setHeader name="sendFrom"> <constant>sender@pricefx.com/constant> </setHeader> <setHeader name="sendTo"> <constant>recipient@pricefx.com</constant> </setHeader> <to uri="pfx-smtps:send?subject=Subject&amp;from=${headers.sendFrom}&amp;to=${headers.sendTo}"/> </route>

Send Email Using Default Camel Mail Property

Send an email using content defined in the body and subject defined in a URI parameter. This example sets the mail message content type to HTML, using the standard Camel Mail component property contentType:

<route> <from uri="direct:start"/> <setBody> <groovy>'Mail content'</groovy> </setBody> <to uri="pfx-smtps:send?contentType=text/html&amp;subject=Subject"/> </route>

 

IntegrationManager version 5.8.0