Hi  

I just checked the MailProducer, it doesn't store the Message Id to the camel 
message header.
So you cannot access the message header here.

I just fill a JIRA[1], and will commit a quick fix for it.

[1]https://issues.apache.org/jira/browse/CAMEL-5910
--  
Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) 
(English)
          http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem


Sent with Sparrow (http://www.sparrowmailapp.com/?sig)


On Tuesday, December 25, 2012 at 2:11 AM, John.R.Moore wrote:

> 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 
> (mailto: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 
> (http://Nabble.com).



Reply via email to