Hi

The documentation is being fixed.

Using a custom mail sender is tested from this unit test
org.apache.camel.component.mail.MailCustomMailSenderTest

On Sat, Mar 14, 2015 at 5:05 AM, Woonsan Ko <woon_...@yahoo.com.invalid> wrote:
> After playing with mail component for smtp (camel-2.14.2), I think I found 
> some problems.
>
> First, the documentation about 'javaMailSender' property [1] seems wrong and 
> totally misleading. It should have referred to 
> org.apache.camel.component.mail.JavaMailSender, not 
> org.springframework.mail.javamail.JavaMailSender.
>
> The second problem is, there seems to be no way to set a reference to a 
> JavaMailSender bean through URI parameters. It seems always to treat the 
> parameter as String even when prefixed by '#' like the '#mySearchTerm' 
> example in [1].
>
> Shall I file JIRA issues for those?
>
> By the way, for some reason, I have to send e-mail via a server which host 
> name contains an underscore. e.g, mail_server.example.com. If a host name 
> contains an underscore, java.net.URI returns null on #getHost() call because 
> it's wrong according to RFC 952 and RFC 1123. But in reality host names with 
> underscore seem to have been allowed by servers and browsers.
> Anyway, my workaround solution for now was to set 'host' parameter while 
> placing something meaningless in the host part of the URI like the following 
> example:
>
>       <to 
> uri="smtp://foo/?host=mail_server.example.com&amp;username=TESTER&amp;..." />
>
> But, if they can already use it in mail applications or browsers, then why 
> not allowing it as well in Camel?
>
> Regards,
>
> Woonsan
>
> [1] http://camel.apache.org/mail.html
>
>
> --------------------------------------------
> On Fri, 3/13/15, Woonsan Ko <woon_...@yahoo.com.INVALID> wrote:
>
>  Subject: Re: SMTP with JNDI Mail Session
>  To: "users@camel.apache.org" <users@camel.apache.org>, "Woonsan Ko" 
> <woon_...@yahoo.com>
>  Date: Friday, March 13, 2015, 1:12 PM
>
>  Oh, maybe I can specify
>  'javaMailSender' parameter.FWIW, I've just found
>  an example configuring a javaMailSender bean using jndi: -
>  https://rozvoj.fit.cvut.cz/Main/spring-mail-a-jndi
>
>  Thanks anyway,
>  Woonsan
>
>
>        From: Woonsan Ko <woon_...@yahoo.com.INVALID>
>   To:
>  "users@camel.apache.org"
>  <users@camel.apache.org>
>
>   Sent: Friday, March 13, 2015 11:58 AM
>   Subject: SMTP with JNDI Mail Session
>
>  Hi,
>  Can I use JNDI resource name in smtp: endpoint
>  instead of having to specify the detail in either the URL or
>  MailComponent bean [1]. It should be very useful if I can
>  simply refer to the configured JNDI mail session in the
>  container.
>
>  Thanks in
>  advance,
>  Woonsan
>
>  [1] http://camel.apache.org/mail.html
>
>
>



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

Reply via email to