Search The ForumSearch   RegisterRegister  LoginLogin

MailBee POP3

 AfterLogic Forum : MailBee POP3
Subject Topic: Delete messages Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
Tom
Guest Group
Guest Group


Joined: 10 November 2003
Online Status: Online
Posts: 262
Posted: 02 September 2004 at 7:09am | IP Logged Quote Tom

Is it possible to delete messages with mailBee pop3, and if not, how can a message be uniquely identified?
Back to Top View Tom's Profile Search for other posts by Tom
 
Alex
AfterLogic Support
AfterLogic Support
Avatar

Joined: 19 November 2003
Online Status: Offline
Posts: 2206
Posted: 02 September 2004 at 7:28am | IP Logged Quote Alex

MailBee POP3 object allows both deleting and unique identification of messages.

To delete a message, you can use POP3.DeleteMessage method (the sample below deletes first message from the mailbox):
Code:

Set objPOP3 = CreateObject("MailBee.POP3")
objPOP3.LicenseKey = "Your MailBee key"
If objPOP3.Connect("mail.server.com", 110, "user", "pass") Then
  objPOP3.DeleteMessage 1
  objPOP3.Disconnect
End If


To uniquely identify messages, you can use POP3.Search method to get array of Unique-ID's of all messages in the mailbox, or POP3.GetMessageUID/POP3.GetMessageNumberFromUID methods to get individual Unique-ID value for specified message number and vice versa.

Regards,
Alex
Back to Top View Alex's Profile Search for other posts by Alex
 
Tom
Guest Group
Guest Group


Joined: 10 November 2003
Online Status: Online
Posts: 262
Posted: 02 September 2004 at 7:36am | IP Logged Quote Tom

Thanks for the prompt reply! Couldn't find that method in the documentation...
Back to Top View Tom's Profile Search for other posts by Tom
 
Jake
Guest Group
Guest Group


Joined: 10 November 2003
Online Status: Online
Posts: 262
Posted: 13 October 2004 at 9:38am | IP Logged Quote Jake

What would I use to delete the ALL the emails in the inbox? Thanks!
Back to Top View Jake's Profile Search for other posts by Jake
 
Alex
AfterLogic Support
AfterLogic Support
Avatar

Joined: 19 November 2003
Online Status: Offline
Posts: 2206
Posted: 13 October 2004 at 9:47am | IP Logged Quote Alex

To delete all messages, just use the loop like below:
Code:

Set objPOP3 = CreateObject("MailBee.POP3")
objPOP3.LicenseKey = "Your MailBee key"
If objPOP3.Connect("mail.server.com", 110, "user", "pass") Then
  For I = 1 To objPOP3.MessageCount Then
    objPOP3.DeleteMessage I
  Next
objPOP3.Disconnect
End If


POP3 protocol does not support "delete all messages" within single command, so using the loop is the only way to delete multiple messages.

Regards,
Alex
Back to Top View Alex's Profile Search for other posts by Alex
 
Jake
Guest Group
Guest Group


Joined: 10 November 2003
Online Status: Online
Posts: 262
Posted: 13 October 2004 at 11:12am | IP Logged Quote Jake

Only nine minutes for a response. I'm sold! Thank you Alex.
Back to Top View Jake's Profile Search for other posts by Jake
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump

Powered by Web Wiz Forums version 7.9
Copyright ©2001-2004 Web Wiz Guide