You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by HockeyDave <da...@yahoo.com> on 2008/10/24 23:26:58 UTC

camel-mail bug 1.4.0 smtp mail relay

This doesn't work.
Map map = new HashMap();
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.";
// Note, no user here because it's a relay server and doesn't require auth
for internal relay
template.sendBodyAndHeaders("smtp://mailserver.apache.org", body, map);

Get a NullPointerException.  

But this does work:

Map map = new HashMap();
//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.";
// Note the to address in the URI
template.sendBodyAndHeaders("smtp://mailserver.apache.org?to=davsclaus@apache.org",
body, map);
-- 
View this message in context: http://www.nabble.com/camel-mail-bug-1.4.0-smtp-mail-relay-tp20157632s22882p20157632.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: camel-mail bug 1.4.0 smtp mail relay

Posted by Gert Vanthienen <ge...@skynet.be>.
L.S.,

Could you raise a JIRA issue for this and put the full stacktrace in 
there? 
If you could create a unit test or a patch to go with it, that would be 
awesome!

Regards,

Gert

HockeyDave wrote:
> This doesn't work.
> Map map = new HashMap();
> 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.";
> // Note, no user here because it's a relay server and doesn't require auth
> for internal relay
> template.sendBodyAndHeaders("smtp://mailserver.apache.org", body, map);
>
> Get a NullPointerException.  
>
> But this does work:
>
> Map map = new HashMap();
> //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.";
> // Note the to address in the URI
> template.sendBodyAndHeaders("smtp://mailserver.apache.org?to=davsclaus@apache.org",
> body, map);
>