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", "[EMAIL PROTECTED]");
map.put("From", "[EMAIL PROTECTED]");
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", "[EMAIL PROTECTED]");
map.put("From", "[EMAIL PROTECTED]");
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://[EMAIL PROTECTED]",
body, map);

Reply via email to