System.Net.Mail.SmtpPermissionAttribute Class

Controls access to Simple Mail Transport Protocol (SMTP) servers.

See Also: SmtpPermissionAttribute Members

Syntax

[System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.All, AllowMultiple=true, Inherited=false)]
public sealed class SmtpPermissionAttribute : System.Security.Permissions.CodeAccessSecurityAttribute

Remarks

The System.Net.Mail.SmtpPermission and System.Net.Mail.SmtpPermissionAttribute classes control access to SMTP host computers. The System.Net.Mail.SmtpClient class demands an System.Net.Mail.SmtpPermission when sending electronic mail to the SMTP host for delivery.

The System.Net.Mail.SmtpAccess enumeration specifies the level of access controlled by an instance of this permission.

Requirements

Namespace: System.Net.Mail
Assembly: System (in System.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0