changing header (Recipient Header)
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   y_s
Posted On:   Sunday, March 3, 2002 05:17 PM

Hi If i set the TO header twice, shouldn't the send one over-writer the first one. Instead it adds the second one and the msg is sent to both email addresses. How can i get it to remove the first TO header and send it to the second one only. // make a msg MimeMessage message = new MimeMessage(ses); message.setFrom(new InternetAddress(from)); message.addRecipient(Message.RecipientType.TO, new InternetAddress("email@emailAddress.com")); message.addRecipient(Message.RecipientType.TO, new InternetAddress("el@eA.com")); Thanx in advance    More>>

Hi

If i set the TO header twice, shouldn't the send one over-writer the first one. Instead it adds the second one and the msg is sent to both email addresses.



How can i get it to remove the first TO header and send it to the second one only.

			
// make a msg
MimeMessage message = new MimeMessage(ses);
message.setFrom(new InternetAddress(from));
message.addRecipient(Message.RecipientType.TO, new InternetAddress("email@emailAddress.com"));
message.addRecipient(Message.RecipientType.TO, new InternetAddress("el@eA.com"));


Thanx in advance


   <<Less

Re: changing header (Recipient Header)

Posted By:   John_Zukowski  
Posted On:   Sunday, March 3, 2002 10:18 PM

addRecipient() does what it says, it ADDS. Use setRecipients() to replace all recipients.
About | Sitemap | Contact