SmtpAccess Enumeration


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Specifies the level of access allowed to a Simple Mail Transport Protocol (SMTP) server.

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

type SmtpAccess

Member nameDescription

Connection to an SMTP host on the default port (port 25).


Connection to an SMTP host on any port.


No access to an SMTP host.

The SmtpAccess enumeration is used by the SmtpPermission and SmtpPermissionAttribute classes to specify a level of access to an SMTP host computer. The SmtpClient class demands an SmtpPermission when sending electronic mail to the SMTP host for delivery.

The following code example uses the SmtpAccess enumeration to create a permission object.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 2.0
Return to top