SharePoint 2016 Administration - Configure Outgoing Email Settings Using PowerShell

After installation of SharePoint Server 2016, once you are done with the initial configurations of the Farm, we can configure Outgoing Email Settings.

Outgoing email configuration enables SharePoint users to monitor SharePoint artifacts like Lists & Libraries. In addition, it also allows site Administrators to receive the messages regarding the administrative issues.

In this article, we will see the steps and PowerShell scripts involved in configuring outgoing Email settings in SharePoint 2016 for a specific Web Application.

Launch Central Administration site.

Click Manage Web Applications link under Application Management.

1

Select the Web Application out of the list of the available Web Applications.

Click General Settings Ribbon Control to select an Outgoing Email.

2

This launches the Web Application Outgoing Email Settings screen in the Modal Dialog.

3

From now onwards, we have two choices to configure the Outgoing Email Settings, where the first one is to make the use of SharePoint user interface, as shown above or configure the settings, using PowerShell Script to support automation scenarios.

In this article, we will see the configuration is done, using PowerShell. Before we execute the corresponding PowerShell Commands, we would visit to the Web Application and see, if it is accessible, as shown below.

4

Next step is to execute PowerShell script given below to update the outgoing E-mail settings.

PowerShell script

  • Get handle on Web Application to which we want to apply outgoing email settings.

    $webAppObj = Get-SPWebApplication -Identity http://sp-2016-dev
  • Once we are able to the get the Web Application Object, we will call the UpdateMailSettings methods, which accepts the parameters given below.

    7.png
    $webAppObj.UpdateMailSettings(“sp2016mail.prashant.com”,”do-not-reply@prashant.com”,”do-not-reply@prashant.com”, 65001)
  • Finally call the Update method to persist the changes to SharePoint database.

    $webAppObj.Update()

Execution

  • Launch SharePoint 2016 Management Shell.
  • Execute the commands, as mentioned above.

5

Once the commands are executed successfully, we can go back to SharePoint outgoing email settings to verify if the settings have been updated or not.

If the execution has been completed without an error; we would be looking at the properties saved, as shown below.

6

That is it for this demo.

Hope, you find it helpful.