SPUtility.SendEmail 方法 (SPWeb, Boolean, Boolean, String, String, String, Boolean)

将电子邮件发送到指定的地址。

命名空间:  Microsoft.SharePoint.Utilities
程序集:  Microsoft.SharePoint(位于 Microsoft.SharePoint.dll 中)

语法

声明
Public Shared Function SendEmail ( _
    web As SPWeb, _
    fAppendHtmlTag As Boolean, _
    fHtmlEncode As Boolean, _
    to As String, _
    subject As String, _
    htmlBody As String, _
    appendFooter As Boolean _
) As Boolean
用法
Dim web As SPWeb
Dim fAppendHtmlTag As Boolean
Dim fHtmlEncode As Boolean
Dim to As String
Dim subject As String
Dim htmlBody As String
Dim appendFooter As Boolean
Dim returnValue As Boolean

returnValue = SPUtility.SendEmail(web, _
    fAppendHtmlTag, fHtmlEncode, to, _
    subject, htmlBody, appendFooter)
public static bool SendEmail(
    SPWeb web,
    bool fAppendHtmlTag,
    bool fHtmlEncode,
    string to,
    string subject,
    string htmlBody,
    bool appendFooter
)

参数

  • fAppendHtmlTag
    类型:System.Boolean

    true将 HTML 标记追加到该邮件。否则为false。

  • fHtmlEncode
    类型:System.Boolean

    true对邮件进行编码和替换 HTML 格式的字符标记实体 ;否则为false。

  • subject
    类型:System.String

    一个包含电子邮件的主题的字符串。

  • htmlBody
    类型:System.String

    一个字符串,包含电子邮件的正文。

  • appendFooter
    类型:System.Boolean

    true如果网站的电子邮件页脚应追加到邮件正文中 ;否则为false。

返回值

类型:System.Boolean
true如果成功,则发送该电子邮件否则为false。

备注

网站的电子邮件页脚来自ServerEmailFooter CAML 标记中的网站定义

备注

此方法支持仅对有效的 SharePoint 用户电子邮件地址发送电子邮件。

另请参阅

引用

SPUtility 类

SPUtility 成员

SendEmail 重载

Microsoft.SharePoint.Utilities 命名空间