Login  
Search All Forums
Dart Home | PowerTCP Mail for .NET | Custom Development Reply | PowerTCP Mail for .NET Topics | Forums   
AuthorForum: PowerTCP Mail for .NET
Topic: How to mark imap messages for deletion using imports dart.mail
4rajya

From: India
Posts: 4
Member Since: 04/13/15
posted September 18, 2015 5:28 AM

imports dart.mail
Dim imap1 As New Imap

try

imap1.Session.RemoteEndPoint = New Dart.Mail.IPEndPoint(domainname, Imap.GetDefaultPort(imap1.Session)) 'myServer, Imap.GetDefaultPort(imap1.Session))

 imap1.Session.Username = username
 imap1.Session.Password = password
 imap1.Connect()
 imap1.Authenticate()
 imap1.SelectedMailbox = imap1.Mailboxes("INBOX")

 Dim messages As ImapMessage() = imap1.SelectedMailbox.ToArray()

If (messages.Count > 0) Then
For Each msg As ImapMessage In messages
   msg.Get()
// do something

  msg.deleted=true //giving error
 now i want to mark each message for deletion

next
// messages which are marked for deletion only should be purgerd.
 
msg.purge() // not working

end if


catch
end try


how to mark each imap message for deletion.once the for loop exits i want to purge the marked deleted messages.Please help me in this aspect.
Jamie Powell (Admin)

From: Rome, NY USA
Posts: 448
Member Since: 03/13/07

Extra Support Options
Custom Application Development

posted September 18, 2015 3:51 PM

The ImapMessage.Update() method is used to set or remove flags, such as the delete flag:
http://www.dart.com/help/ptmlnet/webframe.html#Dart.Mail~Dart.Mail.ImapMessage~Update.html

See the ImapMessage.Deleted property documentation for more information:
http://www.dart.com/help/ptmlnet/webframe.html#Dart.Mail~Dart.Mail.ImapMessage~Deleted.html
4rajya

From: India
Posts: 4
Member Since: 04/13/15
posted September 30, 2015 7:28 AM

Thank you Jamie Powell.

Its working :)
Reply | PowerTCP Mail for .NET Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX