SmtpPermission::AddPermission Method (SmtpAccess)

 

Adds the specified access level value to the permission.

Namespace:   System.Net.Mail
Assembly:  System (in System.dll)

public:
void AddPermission(
	SmtpAccess access
)

Parameters

access
Type: System.Net.Mail::SmtpAccess

One of the SmtpAccess values.

Use this method to modify access to Simple Mail Transport Protocol servers by adding to the state of this permission instance.

The following code example adds Connect access to a permission object.

static SmtpPermission^ GiveFullAccess(
    SmtpPermission^ permission)
{
    permission->AddPermission(SmtpAccess::Connect);
    return permission;
}

.NET Framework
Available since 2.0
Return to top
Show: