<PackageReference Include="System.Security.Permissions" Version="9.0.6" />

SmtpPermission

Controls access to Simple Mail Transport Protocol (SMTP) servers.
public SmtpAccess Access { get; }

Gets the level of access to SMTP servers controlled by the permission.

public SmtpPermission(bool unrestricted)

Initializes a new instance of the SmtpPermission class with the specified state.

public SmtpPermission(SmtpAccess access)

Initializes a new instance of the SmtpPermission class using the specified access level.

Initializes a new instance of the SmtpPermission class using the specified permission state value.

public void AddPermission(SmtpAccess access)

Adds the specified access level value to the permission.

public bool IsUnrestricted()

Returns a value indicating whether the current permission is unrestricted.