UnescapeIdnDomain Method
Decodes the e-mail address string with Punycode-encoded domain part (IDN) into human-readable form.
Use this method to convert domain part of e-mail address back from Punycode. If the e-mail address does not have international characters, it will be left intact. Can be used for From, To, CC, etc.
As an e-mail address can also contain friendly name, be sure to apply this method to the e-mail address itself ("pure" address). You can use a property like PureFromAddr for that. Also, if you have several addresses (e.g. To or CC field), you need to feed only a single address to this method at once (see Remarks below).
strEscapedAddress = ObjectName.EscapeIdnDomain(EmailAddress) |
Parameters: | ||
EmailAddress As String | E-mail address whose domain part to encode (like "user@domain". | |
Return value As String | E-mail address with Punycode-encoded domain part, or the source string if such encoding is not needed. | |
Remarks: | If you need to decode multiple addresses (such as when decoding PureToAddr property value), you need to split the returned string by "," and decode each address separately. After that, you can concatenate the results back (if you need to). |
Usage example:
Dim Mailer, Msg 'Using visual basic to create object Set Mailer = CreateObject("MailBee.POP3") 'Using ASP to create object 'Set Mailer = Server.CreateObject("MailBee.POP3") 'In ASP use Response.Write instead of MsgBox Mailer.LicenseKey = "put your license key here" Mailer.Connect "mailserver.com", 110, "MyName", "MyPassword" If Mailer.Connected Then If Mailer.MessageCount > 0 Then Set Msg = Mailer.RetrieveSingleMessage(1) If Not Msg Is Nothing Then MsgBox "From e-mail(s) = " & Msg.UnescapeIdnDomain(Msg.PureFromAddr) End If Mailer.Disconnect End If
See Also:
EscapeIdnDomain
Method
PureFromAddr Property
PureToAddr Property
Copyright © 2002-2024, AfterLogic Corporation. All rights reserved.