Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Posts: 69
Registered: ‎08-25-2008
My Device: Not Specified
Accepted Solution

How to remove a specific mail from inbox with client application code?

Hi,

 

How to remove a specific mail from inbox with client application code?  Please suggest any useful links.

 

Advanced thanks.

 

Regards

Sunil.G

Developer
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: How to remove a specific mail from inbox with client application code?

Your question is kind of broad, so it is hard to give you specifics.  

 

First, you need to have the message ID from the original message. Generally, you get this either by snagging the message when it came into the inbox (by implementing FolderListener), or by retrieving a list of mail from the email "Store".

 

Once you have this message ID, you call Folder.deleteMessage().

 

There is a developer lab here:

 

http://na.blackberry.com/eng/developers/resources/labs/listeningforemail.jsp

 

Also, classes to look at in the API reference:

 

Store

Folder

FolderEvent

FolderListener

Session

ServiceConfiguration

Message (the RIM message, not the J2ME)

Developer
Posts: 69
Registered: ‎08-25-2008
My Device: Not Specified

Re: How to remove a specific mail from inbox with client application code?

Thanks alot RexDoug.

Developer
Posts: 69
Registered: ‎08-25-2008
My Device: Not Specified

Re: How to remove a specific mail from inbox with client application code?

Hi RexDoug,

 

with 'Folder.deleteMessage()' I can able to delete mail from blackberry inbox but the mail is still appearing in my outlook express so please give ur solution for deleting the mail in desktop outlook express also.  Iam using below code for delete mail.

 

if (subject.indexOf("Hi")!=-1) {
         System.out.println("---This new message having Hi, so it will be delete from Inbox---");
         messageFolder.deleteMessage(orginalMessage);
     }

 

Regards,

Sunil.g

Highlighted
Developer
Posts: 17,012
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: How to remove a specific mail from inbox with client application code?

if you use OutlookExpress there is no way to remove the message there as it works independent from the BB.
If you mean Outlook you have to change the synchronization settings to let your BB delete mails from your outlook, to do this chose options in your BBs mail application, chose e-mail synchronization and switch "delete on" to "mailbox and handheld".
(names guessed as i was too lazy to switch my BB to english).
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter