Hi

You need to start the producer first, and stop it after use

producer.start()
// use producer as much you like
producer.stop() eg when you app shutdown or you dont need the producer anymore

You know this is low level coding? Camel has a higher level API
For instance you can use a ProducerTemplate to send an email in 1 line of code

This template however need also to be started / stopped. You can
however just create 1 shared instance and keep it around and stop it
when you shutdown


On Mon, Mar 2, 2009 at 1:30 PM, siva naresh <[email protected]> wrote:
>
> Please see the following code snippet..
>
> Endpoint smtpEndPoint = context
>                                
> .getEndpoint("smtp://[email protected]:25?password=password");
>
>    try {
>              producer = smtpEndPoint .createProducer();
>              Exchange ex = producer.createExchange();
>              ex.getIn().setBody("hello");
>               producer.process(ex);
>      } catch (Exception e) {
>                        e.printStackTrace();
>     }
>
> throws
> com.sun.mail.smtp.SMTPSendFailedException: 530 5.7.0 Must issue a STARTTLS
> command first. 6sm5357658qwd.33
>
>
> I figured out that I need to set the following property
> mail.smtp.starttls.enable=true for the above exception.
>
> how do I do set the above property using URI or is there any workaround?
> --
> View this message in context: 
> http://www.nabble.com/configuring-mail-endpoint-tp22287281p22287281.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/

Reply via email to