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
Connect | 1 | Connection to an SMTP host on the default port (port 25). |
ConnectToUnrestrictedPort | 2 | Connection to an SMTP host on any port. |
None | 0 | No access to an SMTP host. |
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
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈