GetRecipientAddr Method

Get specified normal recipient's email address.

[Syntax]
C++: HRESULT GetRecipientAddr( int nCount, BSTR* pVal )
Visual Basic: GetRecipientAddr( nCount As Integer ) As String
C#: string GetRecipientAddr( int nCount )

Parameters

nCount

Ordinal number of normal recipient. The minimum value is 1, the maximum value is returned by method GetRecipientCount.

Return Value

This method returns specified normal recipient's email address.

Usage Example

[Visual Basic]
Sub ParseAllRecipients( emailFile )
  Dim oMsg As new ANPOPLib.POPMSG
  Dim nRet, i, nCount As Integer
  Dim name, address As String
  
  nRet = oMsg.ImportFile( emailFile )
  If nRet <> 0 Then
    MsgBox "error with ImportFile"
    Exit Sub
  End If
  
  nCount = oMsg.GetRecipientCount() 'Parse normal recipients
  For i = 1 To nCount
    name = oMsg.GetRecipientName(i)
    address = oMsg.GetRecipientAddr(i)
  Next
  
  nCount = oMsg.GetCCCount() 'Parse carbon copy recipients
  For i = 1 To nCount
    name = oMsg.GetCCName(i)
    address = oMsg.GetCCAddr(i)
  Next
  
  Set oMsg = Nothing
End Sub

See Also

GetCCCount Method
GetCCName Method
GetCCAddr Method
GetRecipientCount Method
GetRecipientName Method


2001-2007 © Copyright AdminSystem Software Limited. All rights reserved.