Share via


RestrictedAddressList Property

RestrictedAddressList Property

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

The RestrictedAddressList property specifies a list of Microsoft Active Directory paths of senders to be accepted or rejected.

Applies To

IMailRecipient Interface

Type Library

Microsoft CDO for Exchange Management Library

DLL Implemented In

CDOEXM.DLL

Syntax

[Visual Basic]Property RestrictedAddressList As Variant

[C++]HRESULT get_RestrictedAddressList(VARIANTpVal);
HRESULT put_RestrictedAddressList(VARIANT Val);

Parameters

  • pVal
    Returns the value of the RestrictedAddressList property as a reference to a VARIANT.
  • Val
    Sets the value of the RestrictedAddressList property to the value of the VARIANT.

Remarks

The default value for this property is NULL (no addresses defined).

If an e-mail address is not found as belonging to a recipient in Active Directory, the value is invalid. Thus this property is useful only for restricting or accepting addresses that can be resolved in Active Directory.

This property accepts both e-mail addresses and Microsoft Windows Active Directory paths, yet in either case the addresses are converted to Active Directory paths.

For more information, see E-mail Addresses Stored as Active Directory Paths.

Example

This example uses a file URL with the Exchange OLE DB (ExOLEDB) provider. The ExOLEDB provider also supports The HTTP: URL Scheme.

[Visual Basic]

Sub RestrictAddresses(DomainName As String, _ FolderName As String)

'DomainName is something like "MyDomain.contoso.com"
'FolderName is something like "Public Folders/Folder3"

Dim objFolder As New CDO.Folder
Dim objMailRecip As CDOEXM.IMailRecipient
Dim fullurl As String
Dim i

'fullurl might look like:
' "file://./backofficestorage/MyDomain.contoso.com/Public Folders/Folder3"
fullurl = "file://./backofficestorage/" + _
          DomainName + "/" + FolderName

objFolder.DataSource.Open fullurl, , adModeReadWrite, adFailIfNotExists

Set objMailRecip = objFolder

' can build an accept or reject list
objMailRecip.restrictedAddresses = cdoReject 'reject these emails

Dim list(3) As Variant

list(0) = "user@" + DomainName
list(1) = "user1@" + DomainName
list(2) = "user2@" + DomainName

objMailRecip.RestrictedAddressList = list
objFolder.DataSource.Save

MsgBox "Mailbox restrictions for " + FolderName + " set successfully"

End Sub

Send us your feedback about the Microsoft Exchange Server 2003 SDK.

Build: June 2007 (2007.618.1)

© 2003-2006 Microsoft Corporation. All rights reserved. Terms of use.