camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: camel-mail
Date Tue, 08 Jan 2013 13:36:32 GMT
Hi

Welcome to the community.

The code below is from an unit test, which uses a mock mail server
(not a real mail server).
In your scenario, you should change the details to a real mail server
(in case you want to send the emails for real).


On Tue, Jan 8, 2013 at 2:28 PM, tamil13 <tamilvanan101@gmail.com> wrote:
>
> Hi. I am new to camel. just finished studying 'camel in action' book. but
> There is no mail configuration information in it. Using camel, I want to
> send a mail using *smtp* component. I tried everything as much as possible.
> but There is no progress.
> All I need is I want to create a new message, setting properties,
> customizing message body and send it using camel smtp component.
>
> I tried following coding.
>
> ProducerTemplate template;
> Map<String, Object> map = new HashMap<String, Object>();
> map.put("To", "davsclaus@apache.org");
> map.put("From", "jstrachan@apache.org");
> map.put("Subject", "Camel rocks");
>
> String body = "Hello Claus.\nYes it does.\n\nRegards James.";
> template.sendBodyAndHeaders("smtp://davsclaus@apache.org", body, map);
>
> I am getting null pointer exception in template.sendBodyAndHeaders() method.
> when I run above code.
>
>
> Thanks in advance...
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/camel-mail-tp5725119.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Mime
View raw message