08-21-2008 09:09 AM
I have a problem to change incoming message into another.
I recieve a message, usingFolderListener and method messagesAdded(FolderEvent e) i can get the message.
Then, i would like to do either one of this scenario:
1. remove attachment in the inbox message and insert new one
2. create new inbox message that will looks like an incoming message and contains attachment (word type)
For first one, i've tried something like :
- get message from FolderEvent using
- get content of message using
lObject = msg.getContent();
- retyping it into Multipart (the mail is having the attachment, so it is multipart) :
Multipart lPart = (Multipart) lObject;
- create SupportedAttachmentPart
SupportedAttachmentPart attach = new SupportedAttachmentPart( lPart, "application/msword", "test.doc" , lData);
- Insert it into message
But with no succes, the attachment was not there.
Then i'we tried to create new message using this code/function :
public void CreateMessage(String iAttachmentName, byte iAttachmentData)
Store store = Session.getDefaultInstance().getStore();
inbox = store.getFolder("Inbox");
Message msg = new Message(inbox);
Address toList = new Address;
toList = new Address("email@example.com", "BlazejBB");
msg.setSubject("Sample generated message");
Multipart multipart = new Multipart();
SupportedAttachmentPart attach = new SupportedAttachmentPart( multipart, GetMimeType(iAttachmentName), iAttachmentName, iAttachmentData );
The message is created, but it's icon is the draft message icon, not the envelope i would like to have.
So, can i add attachment into incoming message? Or can i create new message in inbox that would looks like recieved message?
08-21-2008 09:57 AM
after 'walking' and watching all topics in this forum, i've found this one
so hopefully this would help me with no. 2.
08-21-2008 11:32 AM - edited 08-21-2008 11:33 AM
What type of attachment are you trying to update? What is your target BlackBerry handheld software version?
Note that doing this can prevent the attachment from being displayed to the user because the attachment no longer went through the Attachment Distiller on the BlackBerry Enterprise Server.
08-26-2008 09:08 AM
I'm recieving encrypted attachment, extension is .scef. This contains encrypted email (mime mail). Then i exctract attachments that are stored inside and append them into new mail, ie. i'm reconstructing the original mail. The first way was to replace the original mail with the new one, now, but i was not able to do that. Now, i'm creating new one with content from decrypted attachment.
My BB software 220.127.116.11 , build 75.
Problem with displaying attachmentthat had not come through the BES is solved using Doc2Go.