| Author |  | 
      
        | Guests Guest Group
 
  
 
 Joined: 10 November 2003
 Online Status: Online
 Posts: 262
 | 
          Hi,
           | Posted: 28 November 2004 at 1:31pm | IP Logged |   |  
           | 
 |  
 I'm having little bit of a problem with mail deleting, I'm sure it's very easy to fix but I can't figure it out and it's frustrating. Anyway...
 
 The delete meail method only works with message index and I'm having a hard time tracking the message index of messages, and I sometimes end up deleting messages that I don't want to. Is there any other method that deletes messages by UID ? or some other property ? I could not find that in the help documents.
 
 Thanks
 
 
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Alex AfterLogic Support
 
  
  
 Joined: 19 November 2003
 Online Status: Offline
 Posts: 2207
 | 
          You can use GetMessageNumberFromUID to obtain message number from UID and then pass this number to DeleteMessage method.
           | Posted: 28 November 2004 at 2:35pm | IP Logged |   |  
           | 
 |  
 n = POP3.GetMessageNumberFromUID(myUID)
 If n > 0 Then
 POP3.DeleteMessage n
 Else
 MsgBox "Invalid UID!"
 End If
 
 Regards,
 Alex
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Guests Guest Group
 
  
 
 Joined: 10 November 2003
 Online Status: Online
 Posts: 262
 | 
          oPop3.GetMessageNumberFromUID(myUID) always returns 0x0 for me.
           | Posted: 15 December 2004 at 2:22pm | IP Logged |   |  
           | 
 |  
 Why?
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Alex AfterLogic Support
 
  
  
 Joined: 19 November 2003
 Online Status: Offline
 Posts: 2207
 | 
          Are you sure you already connected to mail server to the moment of calling GetMessageNumberFromUID method?
           | Posted: 16 December 2004 at 7:46am | IP Logged |   |  
           | 
 |  
 E.g:
 
 Set POP3 = CreateObject("MailBee.POP3")
 POP3.LicenseKey = "key"
 If POP3.Connect("mail.server.com", 110, "user", "pass") Then
 n = POP3.GetMessageNumberFromUID(uid)
 End If
 
 If this is not the issue, are you sure the message with the specified UID still present in the mail account (e.g. it has not been already deleted?)
 
 Also, make sure UID itself is valid. If it's enclosed in angle brackets "<>", remove them before passing value to GetMessageNumberFromUID method.
 
 Regards,
 Alex
 
 | 
       
        | Back to Top |     | 
       
       
        |  |