Unsubscribe Method


Unsubscribes specified mailbox.

Many mail programs check subscribed mailboxes only.

To get list of subscribed mailboxes, use call RetrieveMailboxes method with SubscribedOnly parameter set to True.

If mailbox names you're dealing with may contain non-English characters, please read UTF7EncodeMailboxNames topic to make sure everything's done right.


blnResult = ObjectName.Unsubscribe(MailboxName)  
Parameters:  
MailboxName As String Name of the mailbox to subscribe  
Return value As Boolean True if successful, False if error has occurred. You can check ErrDesc property or log file to get more detailed error information  

Usage example:

' This sample unsubscribes "Archive" mailbox. It's assumed this mailbox already exists

Dim Mailer
'Using visual basic to create object
Set Mailer = CreateObject("MailBee.IMAP4")
'Using ASP to create object
'Set Mailer = Server.CreateObject("MailBee.IMAP4")
'In ASP use Response.Write instead of MsgBox

Mailer.EnableLogging = True ' Logging helps to discover any problems
Mailer.LogFilePath = "C:\Temp\imap4_log.txt"

Mailer.LicenseKey = "put your license key here"
If Mailer.Connect("mailserver.com", 143, "MyName", "MyPassword") Then
  Mailer.Unsubscribe("Archive")
  Mailer.Disconnect
Else
  MsgBox Mailer.ErrDesc
End If

See Also:

RetrieveMailboxes Method
Unsubscribe Method


Copyright © 2002-2022, AfterLogic Corporation. All rights reserved.