Thank you.
Yes I saw this file ; but how define this property and others (the "from" or
"suject") using Java DSL?

Here my test class:


public class Test {

        /**
         * @param args
         * @throws Exception 
         */
        public static void main(String[] args) throws Exception {
                CamelContext context = new DefaultCamelContext();

                context.addRoutes(new RouteBuilder() {

                    public void configure() {
                        
from("timer:myTimerEvent?fixedRate=true&delay=0&period=1000")
                                  // this works!
                        //.setBody(Builder.constant("Salut !")).to("log:test");

                                  // How define smtp host?
                        .setBody(Builder.constant("Salut
!")).to("smtp://[EMAIL PROTECTED]");
                        
                    }
                    
                });
                
                context.start();
                
                Thread.sleep(5000);

        }

}



Frank Lynch-2 wrote:
> 
> Hi Bertrand,
> I believe "[EMAIL PROTECTED]" is the address to which the email will be
> delivered. 
> You can set the SMTP server via a properties object eg:
> 
>         Properties properties = new Properties();
>         properties.put("mail.smtp.host", "localhost");
>         mailSession = Session.getInstance(properties, null);
> 
> This code fragment was taken from MailMessageTest.java in:
>  /components/camel-mail/src/test/java/org/apache/camel/component/mail/
> HTH,
> --Frank
> 
> 
> 
> On Fri, 2007-09-14 at 08:32 -0700, bgoetzmann wrote:
>> Hi,
>> 
>> Camel is a very interesting project ! Thank you for all developers of
>> this
>> project.
>> 
>> Trying a first Java application I would like to send emails using a route
>> ;
>> so I try something like
>> 
>> ... .to("smtp://[EMAIL PROTECTED]")
>> 
>> but is [EMAIL PROTECTED] must be a address mail at witch you send the mail?
>> How
>> can I specify the smtp server?
>> 
>> I appreciate an example.
>> 
>> Thank you!
>> 
>> Bertrand.
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Sending-an-email-with-Camel-tf4443341s22882.html#a12678558
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to