SetEmailConfiguration 方法 (WMI MSReportServer_ConfigurationSetting)

配置报表服务器用来发送电子邮件的电子邮件传递扩展插件。

语法

Public Sub SetEmailConfiguration(ByVal SendUsingSMTPServer As Boolean, _
    ByVal SMTPServer As String, ByVal SenderEmailAddress As String, _
    ByRef HRESULT As Int32)
public void SetEmailConfiguration (Boolean SendUsingSMTPServer, 
   string SMTPServer, string SenderEmailAddress, 
   out Int32 HRESULT);

参数

  • SendUsingSMTPServer
    指示相应服务器是否将使用 SMTP 服务器发送电子邮件的布尔值。此值仅可设置为 true。默认值为 false。

  • SMTPServer
    包含 SMTP 服务器的名称或 IP 地址的字符串。

  • SenderEmailAddress
    从报表服务器发出的电子邮件的“发件人:”字段中使用的电子邮件地址。

  • HRESULT
    [out] 指示调用是成功还是失败的值。

返回值

返回 HRESULT,指示方法调用是成功还是失败。值 0 指示方法调用已成功。非零值指示已发生错误。

注释

如果将 SendUsingSMTPServer 参数设置为 true,则报表服务器配置文件中的 SendUsing 条目将设置为 1。如果将 SendUsingSMTPServer 设置为 false,则不会配置 SendUsing 条目。

此方法没有为用户提供将报表服务器配置文件中的 SendUsing 条目设置为 1 以外的值的方式。若要将报表服务器配置为不使用 SMTP 邮件服务器,您必须手动编辑此配置文件。

要求

命名空间: root\Microsoft\SqlServer\ReportServer\RS_<EncodedInstanceName>\v10\Admin

平台: Windows Server 2003 Datacenter Edition;Windows Server 2003 Enterprise Edition;Windows Server 2003 Standard Edition;Windows Vista;Windows XP Professional Service Pack 2 (SP2) 或 Service Pack 1 (SP1) 或者 Windows 2000(所有版本)