You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Hilderich <hi...@yahoo.de> on 2013/08/07 22:32:21 UTC

smtp option contentType=text/html has no effect

Hello folks!

We are using Camel 2.10.4. 

Before sending an email I create the html email message via Apache Velocity.
The smtp component
has the option contentType and that's why I have set it to "text/html".
However this configuration
has no effect and I receive the email as plain text. 
After I have explicit changed the exchange header Exchange.CONTENT_TYPE to
"text/html" it is working.

Has anybody the knowledge why?

Cheers
Hilderich



--
View this message in context: http://camel.465427.n5.nabble.com/smtp-option-contentType-text-html-has-no-effect-tp5736951.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: smtp option contentType=text/html has no effect

Posted by cdryst <cd...@gmail.com>.
Hello, I know it's a little late for ask but I have this issue right now, I
have put trace on and I can see that the contentType header is set to
text/html and has not been overwritten.

One curious thing is that when I test it on development mode it sends the
email in the right format, but when I deploy it to production env it misses
the header, 

This is the header traced:

<code>
INFO  Tracer                         - xxxx-57685-1399307391691-0-2 >>>
(contactusPr) velocity://contactus/recevied.vm -->
smtp://my.mail.server?contentType=text%2Fhtml <<< Pattern:InOut,
Headers:{Connection=Keep-Alive, CamelServletContextPath=/contactus,
X-WebLogic-Request-ClusterInfo=true, Chronos=aggregate,
X-WebLogic-KeepAliveSecs=30, CamelHttpUri=/app/camel/contactus,
CamelHttpUrl=https://www.myserver.com:443/app/camel/contactus,
Accept-Language=es-ES,es;q=0.8,en-US;q=0.5,en;q=0.3, To=mail@domain.com,
User-Agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:28.0)
Gecko/20100101 Firefox/28.0, param1=143570
</code>



--
View this message in context: http://camel.465427.n5.nabble.com/smtp-option-contentType-text-html-has-no-effect-tp5736951p5750879.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: smtp option contentType=text/html has no effect

Posted by Hilderich <hi...@yahoo.de>.
Thank you, Claus!



--
View this message in context: http://camel.465427.n5.nabble.com/smtp-option-contentType-text-html-has-no-effect-tp5736951p5736987.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: smtp option contentType=text/html has no effect

Posted by Claus Ibsen <cl...@gmail.com>.
Maybe there is a header with key contentType or Content-Type etc that
would override the endpoint configuration.

I suggest to check for that. You can use the tracer to see the message
as its routed in Camel etc.
http://camel.apache.org/tracer

On Wed, Aug 7, 2013 at 10:32 PM, Hilderich <hi...@yahoo.de> wrote:
> Hello folks!
>
> We are using Camel 2.10.4.
>
> Before sending an email I create the html email message via Apache Velocity.
> The smtp component
> has the option contentType and that's why I have set it to "text/html".
> However this configuration
> has no effect and I receive the email as plain text.
> After I have explicit changed the exchange header Exchange.CONTENT_TYPE to
> "text/html" it is working.
>
> Has anybody the knowledge why?
>
> Cheers
> Hilderich
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/smtp-option-contentType-text-html-has-no-effect-tp5736951.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen