Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sending HTML emails with spring integration

I am using spring integration for a process which ends in an email being sent.

However, it is an HTML email and I receive the source for it, not the rendered HTML.

I have tried to use the mail header enricher provided with spring-integration-mail 2.1.4 to set the content type or activate multipart without result.

Can it be done with the mail header enricher or is it supposed to be configured in some other way?

A pure XML configuration preferable.

like image 446
Ludwig Magnusson Avatar asked Mar 05 '26 18:03

Ludwig Magnusson


1 Answers

Yes you can send HTML via the XML configuration, you just need to set the content type as you said via the header enricher, example code below.

<int-mail:header-enricher id="emailheaderenricher">
        <int-mail:content-type value="text/html;"/>
        <int-mail:subject value="a subject"/>
        <int-mail:to value="[email protected]"/>
        <int-mail:from value="[email protected]"/>
</int-mail:header-enricher>
like image 85
ThaSaleni Avatar answered Mar 08 '26 20:03

ThaSaleni