You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by MichaelAtSAG <me...@gmail.com> on 2012/01/14 01:32:58 UTC

SMTP - Specify Name and Email in the From element using Spring

How do I specify both a Name and Email in the From

<route id="Email_InvShortage">
	<from uri="direct:Email_InvShortage" />
	<to uri=&quot;smtp://smtp?to=test@company.com&amp;amp;subject=Inventory
shortage alert&amp;amp;from=&lt;Event Notifier> eventReply@company.com" />
</route>

Camel does not like the '<' character in the 'from' value.

Caused by: org.xml.sax.SAXParseException: The value of attribute "uri"
associated with an element type "null" must not contain the '<' character.

--
View this message in context: http://camel.465427.n5.nabble.com/SMTP-Specify-Name-and-Email-in-the-From-element-using-Spring-tp5144138p5144138.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: SMTP - Specify Name and Email in the From element using Spring

Posted by Christian Müller <ch...@gmail.com>.
Hello Michael!

Tests [1] are always a good source of knowledge.
The same is of course possible with the XML DSL. Make sure you escape all
characters which you cannot use in XML. This not means "Camel does not like
the '<' character", it's simple not a valid XML you build...

[1]
https://svn.apache.org/repos/asf/camel/trunk/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailNameAndEmailInRecipientTest.java

Best,
Christian

On Sat, Jan 14, 2012 at 1:32 AM, MichaelAtSAG <me...@gmail.com>wrote:

> How do I specify both a Name and Email in the From
>
> <route id="Email_InvShortage">
>        <from uri="direct:Email_InvShortage" />
>        <to uri=&quot;smtp://smtp?to=test@company.com
> &amp;amp;subject=Inventory
> shortage alert&amp;amp;from=&lt;Event Notifier> eventReply@company.com" />
> </route>
>
> Camel does not like the '<' character in the 'from' value.
>
> Caused by: org.xml.sax.SAXParseException: The value of attribute "uri"
> associated with an element type "null" must not contain the '<' character.
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/SMTP-Specify-Name-and-Email-in-the-From-element-using-Spring-tp5144138p5144138.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>