Hi If you see any exception then that may have details that can lead you to what is wrong etc. And make sure your username and password is correct.
Also you need to set a header with the "to" eg with the email to who is to receive the email. setHeader("to", constant("some...@somewhere.com")) On Sat, May 18, 2013 at 7:04 PM, nickerox <mandrakeli...@tiscali.it> wrote: > Hi Claus, > > I`m testing this simple java code: > > CamelContext ctx = new DefaultCamelContext(); > > ctx.addRoutes(new RouteBuilder() { > > @Override > public void configure() throws Exception { > > from("direct:mail"). > setHeader("subject", constant("Apache camel > test")) > .setHeader("From", > constant("t...@virgilio.it")) > > .to("smtp://usern...@virgilio.it?password=****"); > } > }); > > ctx.start(); > > Endpoint endpoint = ctx.getEndpoint("direct:mail"); > > ProducerTemplate p = new DefaultProducerTemplate(ctx, > endpoint); > p.start(); > p.sendBody("Hello!"); > System.out.println("Sent!"); > p.stop(); > ctx.stop(); > > > receiving this response: Could not connect to SMTP host: virgilio.it, port: > 25 (right, because SMTP server is out.virgilio.it); > If i substitute the endpoint with > "smtp://usern...@out.virgilio.it?password=****" > I get the right AddressFailedException. > So, please, could you help me to understand my error or if i have missed any > properties? > Thx in advance > > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/camel-mail-tp5725119p5732800.html > Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen ----------------- www.camelone.org: The open source integration conference. Red Hat, Inc. FuseSource is now part of Red Hat Email: cib...@redhat.com Web: http://fusesource.com Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen