472,102 Members | 2,117 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,102 software developers and data experts.

Delete SMS from SmartPhone/PDA Inbox

49
Hi,

I have created a SmartPhone/PDA application to send and recieve SMS. Now whenever the application is running and the message comes in, it is shown on the screen and is strored in the inbox(I have tried both the options Notify and NotifyAndDelete but I am not satisfied with that).


I want to delete a SMS from SmartPhone/PDA inbox which has a specific word or string.

I am using compact framework and C#.NET.

Please let me know how we can do it.

Thanks in advance

Regards
LTCCTL
Jun 27 '08 #1
6 7302
markmcgookin
648 Expert 512MB
I think there are some classes for Windows Mobile's telephony or pocket outlook things that would allow you to do this.

You would probably have to loop through each message, pass it to a string reader, then parse the string for your word. If you find the word delete the message.
Jun 27 '08 #2
LTCCTL
49
I think there are some classes for Windows Mobile's telephony or pocket outlook things that would allow you to do this.

You would probably have to loop through each message, pass it to a string reader, then parse the string for your word. If you find the word delete the message.
Hi,

Thanks for your help.

I have done it

Regards
LTCCTL
Jul 15 '08 #3
markmcgookin
648 Expert 512MB
Hi,

Thanks for your help.

I have done it

Regards
LTCCTL
It's always good for communities like this if you post the solution you have come up with. It allows other people to use the answer and saves them having to post and wait for replies.

Also it makes you look smart :)
Jul 23 '08 #4
1.
sm = new Microsoft.WindowsMobile.PocketOutlook.MessageInter ception.MessageInterceptor
(Microsoft.WindowsMobile.PocketOutlook.MessageInte rception.InterceptionAction.NotifyAndDelete,true ) //after listening ,delete message


or
if (!File.Exists(FILE_NAME))
......{
OutlookSession outSess = new OutlookSession();
SmsMessageFolder smsFlr = outSess.SmsAccount.Inbox;

if (smsFlr.Count > 0)
......{
// Only save the first sms found
SmsMessage smsMsg = smsFlr[0];
if (smsMsg.Body.Length > 0)
......{
StreamWriter writeStream = File.CreateText(FILE_NAME);
writeStream.WriteLine(smsMsg.Body);
writeStream.Close();
}
smsMsg.Delete();


2. use AT instructions
AT+CMGD=<message Index>
Aug 22 '08 #5
Alough I know how to delete SMS message,I'm still interested in how did you solve this problem.

-------------------------------Victor Hu
Aug 22 '08 #6
I tried below code snippet to delete

Getting error on this line SmsMessageFolder smsFlr = outSess.SmsAccount.Inbox; saying No priveleges to access SmsAccount.Inbox

Can somebody help with this or post a working snippet to delete message from inbox


OutlookSession outSess = new OutlookSession();
SmsMessageFolder smsFlr = outSess.SmsAccount.Inbox;

if (smsFlr.Count > 0)
......{
// Only save the first sms found
SmsMessage smsMsg = smsFlr[0];
if (smsMsg.Body.Length > 0)
......{
StreamWriter writeStream = File.CreateText(FILE_NAME);
writeStream.WriteLine(smsMsg.Body);
writeStream.Close();
}
smsMsg.Delete();
Jul 14 '09 #7

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

6 posts views Thread by Andrew Banks | last post: by
1 post views Thread by MEGASILVER | last post: by
5 posts views Thread by Cooley | last post: by
4 posts views Thread by Philip Nestingen | last post: by
reply views Thread by amitsd1 | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.