I have a system where I need to record the SMTP Message-ID for every sent
message and use to correlate back responses.   I followed the simple sending
via SMTP examples from http://camel.apache.org/mail.html and had hoped to
find the returned reference somewhere in the exchange to no avail.   

Is the message-id available in the exchange and I'm just not finding it or
do I need to handle the sending of the SMTP message myself and push into the
exchange.out?

Thanks in advance,
John

                <route id="sendToMail">
                        <from uri="direct:toSMTP"/>
                        <pipeline>
                                <to
uri="smtps://smtp.mail.**********.com?username=johnmoore...@ymail.com&amp;password=**********&amp;to=******@*****.com&amp;from=*******@*****.com&amp;subject=offers"
/>
                                <process  ref="dummyProcessor" />
                        </pipeline>
                        <to uri="mock:sentmail"/>
                </route>



        @Test
        public void testSmtpSend() throws Exception {

                assertEquals(ServiceStatus.Started, context.getStatus());

                Exchange exchange = sendMail.createExchange();
                Message in = exchange.getIn();
                in.setBody("John Was Here");
                Producer producer = sendMail.createProducer();
                producer.start();
                producer.process(exchange);
                System.out.println("sent mail");
                Map<String, Object> headers = exchange.getOut().getHeaders();
                for (String key : headers.keySet()) {
                        System.out.println(key + " " + headers.get(key));
                }

        }



--
View this message in context: 
http://camel.465427.n5.nabble.com/How-To-Get-The-SMTP-Message-ID-tp5724581.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to