ToUTF7 Method


Encodes the specified string into UTF-7M.

Usually, UTF-7M is used to encode mailbox names by IMAP servers. Although by default MailBee encodes mailbox names automatically, you may disable automatic encoding via UTF7EncodeMailboxNames property and perform encoding manually using this method.

Moreover, if you disabled automatic encoding mailbox names, but your IMAP server requires mailbox names to be encoded, you should encode mailbox names before passing them to IMAP server. To reference already existing mailboxes (which were retrieved from the IMAP server), use MailBox.OriginalName property.


strUTF7 = ObjectName.ToUTF7(Src)  
Parameters:  
Src As String Source text string  
Return value As String UTF-7-Modified version of the source string.  

Usage example:

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.LicenseKey = "put your license key here"
MsgBox Mailer.ToUTF7("Name with international or special chars")


See Also:

FromUTF7 method
UTF7EncodeMailboxNames property


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