Hi,
You can set the your mail binding form the mail endpoint.
Here is some examples.
Java DSL
MailEndpoint mailEndpoint = new MailEndpoint("MailURI");
mailEndpoint.setBinding(new YourBinding());
from(mailEndpoint).to("other endpoint");
Spring
<bean name="myBinding" class="MyBinding"/>
<bean name="mailEndpoint"
class="org.apache.camel.component.mail.MailEndpoint">
<property name="binding" ref="myBinding"/>
</bean>
<camelContext id="camel"
xmlns="http://activemq.apache.org/camel/schema/spring">
<route>
<from ref="mailEndpoint"/>
<to uri="otherEndpoint"/>
</route>
</camelContext>
Willem
rohitbrai wrote:
> Found a workaround, which satisfies the requirement -
> setHeader("from", constant("Dummy <[email protected]>"))
>
> Where Dummy is the sender name and [email protected] is the sender email.
>
>
>
> rohitbrai wrote:
>> I have a requirement, which should I think should be standard, that when I
>> send the mail I should be able to set the sender name also along with the
>> sender email.
>>
>> Is there any way to do this??? Can I extend the MailBinding class, such
>> that Camel reads my class to create binding for the the mail component?
>>
>> I am asking because I may need to do many customizations to the mail and
>> headers and properties before sending the mail in my application.
>>
>> Regards,
>> Rohit
>>
>>
>>
>