WebMail.Send 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
将指定的邮件发送到 SMTP 服务器以便传递。
public static void Send(string to, string subject, string body, string from = default, string cc = default, System.Collections.Generic.IEnumerable<string> filesToAttach = default, bool isBodyHtml = true, System.Collections.Generic.IEnumerable<string> additionalHeaders = default, string bcc = default, string contentEncoding = default, string headerEncoding = default, string priority = default, string replyTo = default);
static member Send : string * string * string * string * string * seq<string> * bool * seq<string> * string * string * string * string * string -> unit
Public Shared Sub Send (to As String, subject As String, body As String, Optional from As String = null, Optional cc As String = null, Optional filesToAttach As IEnumerable(Of String) = null, Optional isBodyHtml As Boolean = true, Optional additionalHeaders As IEnumerable(Of String) = null, Optional bcc As String = null, Optional contentEncoding As String = null, Optional headerEncoding As String = null, Optional priority As String = null, Optional replyTo As String = null)
参数
- to
- String
收件人的电子邮件地址。 使用分号 (;) 分隔多名收件人。
- subject
- String
电子邮件的主题行。
- body
- String
电子邮件的正文。 如果 isBodyHtml
为 true,则正文中的 HTML 解释为标记。
- from
- String
(可选) 邮件发件人的电子邮件地址,或为 null 以不指定发件人。 默认值为 null。
- cc
- String
(可选) 要向其发送邮件副本的其他收件人的电子邮件地址,如果没有其他收件人,则为 null。 使用分号 (;) 分隔多名收件人。 默认值为 null。
- filesToAttach
- IEnumerable<String>
(可选) 指定要附加到电子邮件的文件的文件名集合,如果没有要附加的文件,则为 null。 默认值为 null。
- isBodyHtml
- Boolean
(可选) true 以指定电子邮件正文为 HTML 格式;false 表示正文采用纯文本格式。 默认值为 true。
- additionalHeaders
- IEnumerable<String>
(可选) 要添加到此电子邮件中包含的普通 SMTP 标头的标头集合,或为 null 以不发送其他标头。 默认值为 null。
- bcc
- String
(可选) 要向其发送邮件的“盲件”副本的其他收件人的电子邮件地址,如果没有其他收件人,则为 null。 使用分号 (;) 分隔多名收件人。 默认值为 null。
- priority
- String
(可选)用于指定邮件优先级的值(“常规”、“低”、“高”)。 默认值为“常规”。
- replyTo
- String
(可选)收件人回复邮件时将使用的电子邮件地址。 默认值为 null,指示回复地址是 From 属性的值。