SetEmailConfiguration Method (WMI MSReportServer_ConfigurationSetting)
Applies To: SQL Server 2016
Configures the e-mail delivery extension used by the report server to send e-mail.
public void SetEmailConfiguration (Boolean SendUsingSMTPServer, string SMTPServer, string SenderEmailAddress, out Int32 HRESULT);
A Boolean value indicating whether the server is to use the SMTP server to send email. This value can only be set to true. Default value is false.
A string containing the name or IP address of an SMTP server.
The e-mail address used in the 'From:' field for e-mails sent from the report server.
[out] Value indicating whether the call succeeded or failed.
Returns an HRESULT indicating success or failure of the method call. A value of 0 indicates that the method call was successful. A non-zero value indicates that an error has occurred.
When the SendUsingSMTPServer parameter is set to true, the SendUsing entry in the report server configuration file is set to 1. When SendUsingSMTPServer is set to false, the SendUsing entry is not configured.
This method does not provide a way for users to set the SendUsing entry in the report server configuration file to a value other than 1. To configure the report server for anything other than SMTP mail, you must edit the configuration file manually.