Set SharePoint Web Application Email settings using PowerShell

Posted: September 25, 2014 in Wep Applications

When setting up new Web Applications left and right, it can be very frustrating to enter the email settings on the Web Applications. Under is a code-snippet and a Function to set email settings on your Web Applications using PowerShell.

Get-SPWebApplication | % {$_.UpdateMailSettings("", "", "", "65001")}

Here’s a simple function if you want individual settings on your Web Applications:

Function SetEmailSettings ($webapplication, $smtpServer, $FromAddress, $ToAddress)
$CharacterSet = "65001"
$webapp = get-spwebapplication $webapplication
$webapp.UpdateMailSettings($smtpServer, $FromAddress, $ToAddress, $CharacterSet)

Run Function like this:

SetEmailSettings -webapplication http://webappurl -smtpServer -FromAddress -ToAddress

Or just

SetEmailSettings http://webappurl

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s