GetFriendlyName Method


Extracts and returns the friendly name (e.g. John Doe) from the specified full e-mail address (e.g. John Doe <jdoe@domain.com>). If multiple e-mail addresses specified, they must be delimited with commas.

For example, if FullAddr parameter is as following: "Mr. X, Y Company"<mr.x@y.com> (y.com), nofriendlyname@localhost, someone@host.net (Only comment)

then GetFriendlyName will return: Mr. X, Y Company, nofriendlyname@localhost, Only comment


strFriendlyName = ObjectName.GetFriendlyName(FullAddr)
 
Parameters:  
FullAddr As String Full e-mail address or addresses to extract friendly name(s) for  
Delimiter As String (optional) A char or string to delimit returned friendly names with. If missing or empty, will use AddressDelimiter for that  
Return value As String Friendly name part of the specified full e-mail address  

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 "Reply-To person: " & Msg.GetFriendlyName(Msg.ReplyToAddr)
      End If ' If the message does not have Reply-To, empty string will be displayed
   End If
   Mailer.Disconnect
End If

See Also:

GetPureAddr Method


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