Norman Maurer wrote:
If i use:
getMailetContext().sendMail(mail.getSender(), new
MailAddress[]{recipient}.asList(), message, "testProcessor");

i get:
Cannot invoke asList() on the array type MailAddress[]

Sorry, I wrote it too fast:
Arrays.asList(new MailAddress[]{recipient});

i have found the error.. it was a ClassCast exception .. logged in spool
log.

the "(MimeMessage) mail" is you classcast.

I cast the mail.getMessage(); to MimeMessage cause i want to add headers
and save them after that:

mail.getMessage() is alreade a MimeMessage.
You were casting a Mail to MimeMessage.

MimeMessage message = newMail.getMessage();

message.addHeader("X-User", user);
message.addHeader("X-Domain", domain);
message.saveChanges();

I also have removed the mail.setAttributes(); methods. cause the values
get lost afet send the message ..

You don't need them! You have the corrent sender and the corrent recipient in the sent mail: use it! I simply don't understand why you should parse the message to add headers when you already have the informations in the Mail object processed by the spool.

So i want add the headers and get the values i need later out of the
headers.

"later" => WHEN? why? inside james? outside james?

Stefano


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to