BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 09-12-2007, 06:21 AM   #1 (permalink)
CrackBerry Addict
 
Join Date: Apr 2005
Location: hamburg, germany
Model: 8900
Carrier: o2
Posts: 838
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default adding an extra header to an email

Please Login to Remove!

i have added an menuitem on the compose e-mail screen and would like to add an extra header.
i can add recipients or modify the subject but addheader seems not to be working.

Code:
public Object run(Object context) {
try{                	
Message message = (Message) context;          
Message message = (Message) context;                
message.addHeader("REPLY_TO","user@domain.com");
message.addHeader("X-VOODOO", "voodoo on");
...
i call getAllHeaders() to check if the new header is set but the resulting enumeration is empty.

Any idea?
__________________
java developer, Devinto, hamburg/germany
Offline  
Old 09-12-2007, 10:14 AM   #2 (permalink)
Talking BlackBerry Encyclopedia
 
Join Date: Oct 2006
Model: 7103
Carrier: Verizon
Posts: 259
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

you could explicetly select them with the method below..?

RIM Device Java Library: Class Message)
Offline  
Old 09-12-2007, 10:25 AM   #3 (permalink)
CrackBerry Addict
 
Join Date: Apr 2005
Location: hamburg, germany
Model: 8900
Carrier: o2
Posts: 838
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

it seems that the API allows only certain headers to be set, don't ask me why. If i add a 'TO:' header my code works well.
Seems that i'll have to find a new idea to mark certain messages, maybe add some text into the body.
__________________
java developer, Devinto, hamburg/germany
Offline  
Old 09-12-2007, 11:27 AM   #4 (permalink)
Talking BlackBerry Encyclopedia
 
Join Date: Oct 2006
Model: 7103
Carrier: Verizon
Posts: 259
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

oh yeah, I should've looked: These are the guys you want
RIM Device Java Library: Interface Message.RecipientType

Address[] addresses = new Address[1];
addresses[0] = to;
message.addRecipients(Message.RecipientType.TO, addresses);

where to is some Address
etc.
Offline  
Old 04-16-2008, 06:13 AM   #5 (permalink)
New Member
 
Join Date: Apr 2008
Model: 7100v
PIN: N/A
Carrier: Vodafone
Posts: 3
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default struck at similar situation

Simon or others,

COuld you tell me is it possible to add extra headers or is there any other way??
Offline  
Old 04-16-2008, 07:08 AM   #6 (permalink)
BlackBerry Extraordinaire
 
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
Post Thanks: 20
Thanked 77 Times in 68 Posts
Default

I haven't found it documented anywhere, but from what I've been able to do it looks like headers other that the small set supported by the device are silently ignored during transmission.

I would love for some one to prove me wrong though.
Offline  
Old 04-16-2008, 07:26 AM   #7 (permalink)
CrackBerry Addict
 
Join Date: Apr 2005
Location: hamburg, germany
Model: 8900
Carrier: o2
Posts: 838
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

hrbuckley is right, i found no way to add extra headers to an email
__________________
java developer, Devinto, hamburg/germany
Offline  




Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.