I use the following tactic in one of my custom actions:
Mail mail = ...; // Mail object containing the Message
List recipients = ...; // List of MailAddress objects the Message in
the Mail object should be sent to
context.sendMail(mail.getSender(), recipients, mail.getMessage());
Regards,
Brian.
-----Original Message-----
From: Hes Siemelink [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 19, 2003 12:11 PM
To: James Users List
Subject: Splitting a message
Hello,
I am writing a maillet that will split a message with multiple recipients
into two messages.
I wonder how I can manipulate the original mail so it will not be sent to
all recipients. According to the javadoc at
http://james.apache.org/mailet/org/apache/mailet/Mail.html the Mail class
has a method setRecipients(). However, that method does not show up in my
James 2.1.2 and 2.1.3 distributions. Could someone tell me what the story is
with this missing method?
An option is to send both messages through
getMailetContext().sendMail(MimeMessage). If I do that, how can I cancel the
original message? Should I call Mail.setMessage(null)?
Help is greatly appreciated!
cheers,
Hes Siemelink.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]