SmtpAccess Enum
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Specifies the level of access allowed to a Simple Mail Transport Protocol (SMTP) server.
public enum class SmtpAccess
public enum SmtpAccess
type SmtpAccess =
Public Enum SmtpAccess
- Inheritance
Fields
Name | Value | Description |
---|---|---|
None | 0 | No access to an SMTP host. |
Connect | 1 | Connection to an SMTP host on the default port (port 25). |
ConnectToUnrestrictedPort | 2 | Connection to an SMTP host on any port. |
Examples
The following code example uses the SmtpAccess enumeration to create a permission object.
static SmtpPermission^ CreateConnectPermission()
{
SmtpPermission^ connectAccess =
gcnew SmtpPermission(SmtpAccess::Connect);
Console::WriteLine("Access? {0}", connectAccess->Access);
return connectAccess;
}
public static SmtpPermission CreateConnectPermission()
{
SmtpPermission connectAccess = new
SmtpPermission(SmtpAccess.Connect);
Console.WriteLine("Access? {0}", connectAccess.Access);
return connectAccess;
}
Remarks
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.
Applies to
.NET