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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
Developer
divit
Posts: 115
Registered: ‎10-24-2009

Deleting mails

hi..........

 

please help me to solve this problem...

 

is it possible to delete mails both in handheld and account programmatically ?

 

and i want to know about <$removeondelivery>.........

 

 

please guide me regarding this 

 

 

thanks

Please use plain text.
Developer
simon_hain
Posts: 13,775
Registered: ‎07-29-2008
My Carrier: O2 Germany

Re: Deleting mails

this depends on the sync settings of the user. usually a mail deleted on the handheld is also deleted on the account (exchange/notes)

----------------------------------------------------------
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
Please use plain text.
Developer
divit
Posts: 115
Registered: ‎10-24-2009

Re: Deleting mails

can we programmatically delete mails on both ends ??

 

this is the code am using to delete mails

but its deleting only on handheld not on account

 

Store store=null;
	
	try {
		 store = Session.waitForDefaultSession().getStore();
		} catch (NoSuchServiceException e) {
		System.out.println(e.toString());
		}
		
		Folder[]  folders = store.list(Folder.SENT); 
        Folder    sentfolder = folders[0]; 
        
        Message msg[] = null;
        
        try {
			msg=sentfolder.getMessages();
		} catch (MessagingException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
        int count =msg.length;
        
        for(int j=0;j<count;j++)
        {
        	Message m=msg[j];
        	String str=m.getSubject();
        	if(str.startsWith("C"))
        	{
        		sentfolder.deleteMessage(m,true);
        	}
        	
        }
        
	

 

 

Please use plain text.
Developer
simon_hain
Posts: 13,775
Registered: ‎07-29-2008
My Carrier: O2 Germany

Re: Deleting mails

works on my device. as i said, depends on your sync settings.

----------------------------------------------------------
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
Please use plain text.
New Developer
ganeshS
Posts: 133
Registered: ‎12-31-2009

Re: Deleting mails

Hello simon_hain,

 

 

Will you please explain sync settings in detail? I have deleted the email from handheld. But I want to delete it from mail box also. How should I proceed?

 

 

Thank you

 

 

Please use plain text.
Developer
simon_hain
Posts: 13,775
Registered: ‎07-29-2008
My Carrier: O2 Germany

Re: Deleting mails

mail options e-mail-synchronization

----------------------------------------------------------
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
Please use plain text.
New Developer
ganeshS
Posts: 133
Registered: ‎12-31-2009

Re: Deleting mails

Hello simon_hain,

 

 

I found option of (delete on--Mailbox & handheld) in Email Reconciliation.

But not able to find the sync option. Will you please tell me where the option is?

 

 

 

Thank you

Please use plain text.
Developer
simon_hain
Posts: 13,775
Registered: ‎07-29-2008
My Carrier: O2 Germany

Re: Deleting mails

the option you found is the correct one, i mistranslated my (german) menu entry

----------------------------------------------------------
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
Please use plain text.
New Developer
ganeshS
Posts: 133
Registered: ‎12-31-2009

Re: Deleting mails

Hello simon_hain,

 

Thank you for your reply

 

 

I will try this and let you know what happens :smileytongue:

 

 

 

Thanks and regards

 

 

Please use plain text.