发送电子邮件。
命名空间: 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 _
) 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 returnValue As Boolean
returnValue = SPUtility.SendEmail(web, _
fAppendHtmlTag, fHtmlEncode, to, _
subject, htmlBody)
public static bool SendEmail(
SPWeb web,
bool fAppendHtmlTag,
bool fHtmlEncode,
string to,
string subject,
string htmlBody
)
参数
web
类型:Microsoft.SharePoint.SPWebMicrosoft.SharePoint.SPWeb对象表示该网站。
fAppendHtmlTag
类型:System.Booleantrue将 HTML 标记追加到该邮件。否则为false。
fHtmlEncode
类型:System.Booleantrue对邮件进行编码和替换 HTML 格式的字符标记实体 ;否则为false。
to
类型:System.String向其发送电子邮件地址。
subject
类型:System.String一个包含电子邮件的主题的字符串。
htmlBody
类型:System.String一个字符串,包含电子邮件的正文。
返回值
类型:System.Boolean
true如果成功,则发送该电子邮件否则为false。
备注
电子邮件将发送到"收件人"、"抄送"和"密件抄送"标题中指定的地址 (或地址)。
备注
此方法支持仅对有效的 SharePoint 用户电子邮件地址发送电子邮件。
另请参阅
引用
Microsoft.SharePoint.Utilities 命名空间
其他资源
MIME 标头