System.Net.Mail Namespace

System.Net.Mail 命名空间包含用于将电子邮件发送到简单邮件传输协议 (SMTP) 服务器进行传送的类。 The System.Net.Mail namespace contains classes used to send electronic mail to a Simple Mail Transfer Protocol (SMTP) server for delivery.

AlternateView

表示电子邮件的查看格式。 Represents the format to view an email message.

AlternateViewCollection

表示 AlternateView 对象集合。 Represents a collection of AlternateView objects.

Attachment

表示电子邮件的附件。 Represents an attachment to an email.

AttachmentBase

表示电子邮件附件的基类。 Base class that represents an email attachment. AttachmentAlternateViewLinkedResource 类从此类派生。 Classes Attachment, AlternateView, and LinkedResource derive from this class.

AttachmentCollection

存储要作为电子邮件的一部分发送的附件。 Stores attachments to be sent as part of an email message.

LinkedResource

表示电子邮件附件中嵌入的外部资源,如 HTML 附件中的图像。 Represents an embedded external resource in an email attachment, such as an image in an HTML attachment.

LinkedResourceCollection

存储要作为邮件的一部分进行发送的链接资源。 Stores linked resources to be sent as part of an email message.

MailAddress

表示电子邮件发件人或收件人的地址。 Represents the address of an electronic mail sender or recipient.

MailAddressCollection

存储与电子邮件关联的电子邮件地址。 Store email addresses that are associated with an email message.

MailMessage

表示可以使用 SmtpClient 类发送的电子邮件。 Represents an email message that can be sent using the SmtpClient class.

SmtpClient

允许应用程序使用简单邮件传输协议 (SMTP) 来发送电子邮件。 Allows applications to send email by using the Simple Mail Transfer Protocol (SMTP).

SmtpException

表示当 SmtpClient 无法完成 SendSendAsync 操作时引发的异常。 Represents the exception that is thrown when the SmtpClient is not able to complete a Send or SendAsync operation.

SmtpFailedRecipientException

表示当 SmtpClient 不能对特定收件人完成 SendSendAsync 操作时引发的异常。 Represents the exception that is thrown when the SmtpClient is not able to complete a Send or SendAsync operation to a particular recipient.

SmtpFailedRecipientsException

当使用 SmtpClient 发送的电子邮件无法传递给所有收件人时引发的异常。 The exception that is thrown when email is sent using an SmtpClient and cannot be delivered to all recipients.

SmtpPermission

控制对简单邮件传输协议 (SMTP) 服务器的访问。 Controls access to Simple Mail Transport Protocol (SMTP) servers.

SmtpPermissionAttribute

控制对简单邮件传输协议 (SMTP) 服务器的访问。 Controls access to Simple Mail Transport Protocol (SMTP) servers.

枚举

DeliveryNotificationOptions

描述电子邮件的送达通知选项。 Describes the delivery notification options for email.

MailPriority

指定 MailMessage 的优先级。 Specifies the priority of a MailMessage.

SmtpAccess

指定允许的简单邮件传输协议 (SMTP) 服务器访问级别。 Specifies the level of access allowed to a Simple Mail Transport Protocol (SMTP) server.

SmtpDeliveryFormat

要用于使用简单邮件传输协议 (SMTP) 发送传出电子邮件的传递格式。 The delivery format to use for sending outgoing email using the Simple Mail Transport Protocol (SMTP).

SmtpDeliveryMethod

指定如何发送电子邮件。 Specifies how email messages are delivered.

SmtpStatusCode

使用 SmtpClient 类指定发送电子邮件的结果。 Specifies the outcome of sending email by using the SmtpClient class.

委托

SendCompletedEventHandler

表示用来处理 SendCompleted 事件的方法。 Represents the method that will handle the SendCompleted event.

注解

MailMessage类表示一封电子邮件的内容。The MailMessage class represents the content of a mail message. SmtpClient类传输到 SMTP 主机指定来传送邮件的电子邮件。The SmtpClient class transmits email to the SMTP host that you designate for mail delivery. 您可以创建邮件附件使用Attachment类。You can create mail attachments using the Attachment class.