-
Notifications
You must be signed in to change notification settings - Fork 107
SPOutgoingEmailSettings
dscbot edited this page Mar 17, 2023
·
19 revisions
Parameter | Attribute | DataType | Description | Allowed Values |
---|---|---|---|---|
WebAppUrl | Key | String | The URL of the web application. If you want to set the global settings use the Central Admin URL | |
SMTPServer | Required | String | The SMTP server for outgoing mail | |
FromAddress | Required | String | The from address to put on messages | |
ReplyToAddress | Required | String | The email address that replies should be directed to | |
CharacterSet | Required | String | The character set to use on messages | |
UseTLS | Write | Boolean | Use TLS when connecting to the SMTP server (SharePoint 2016 and 2019 only) | |
SMTPPort | Write | UInt32 | The port which is used to connect to the SMTP server (SharePoint 2016 and 2019 only) |
Type: Distributed Requires CredSSP: No
This resource is used to set the outgoing email settings for either a single web application, or the whole farm. To configure the resource for a specific web app, use the URL of the web application for the WebAppUrl property, to change the settings for the whole farm use the URL of the central admin website instead. It is possible to set the outgoing server, from address, reply to address and the character set to be used for emails.
This example shows to set outgoing email settings for the entire farm. Use the URL of the central admin site for the web app URL to apply for the entire farm.
Configuration Example
{
param
(
[Parameter(Mandatory = $true)]
[PSCredential]
$SetupAccount
)
Import-DscResource -ModuleName SharePointDsc
node localhost
{
SPOutgoingEmailSettings FarmWideEmailSettings
{
WebAppUrl = "http://sharepoint1:2013"
SMTPServer = "smtp.contoso.com"
FromAddress = "sharepoint`@contoso.com"
ReplyToAddress = "noreply`@contoso.com"
CharacterSet = "65001"
PsDscRunAsCredential = $SetupAccount
}
}
}
This example shows to set outgoing email settings for a specific web app
Configuration Example
{
param
(
[Parameter(Mandatory = $true)]
[PSCredential]
$SetupAccount
)
Import-DscResource -ModuleName SharePointDsc
node localhost
{
SPOutgoingEmailSettings FarmWideEmailSettings
{
WebAppUrl = "http://site.contoso.com"
SMTPServer = "smtp.contoso.com"
FromAddress = "sharepoint`@contoso.com"
ReplyToAddress = "noreply`@contoso.com"
CharacterSet = "65001"
PsDscRunAsCredential = $SetupAccount
}
}
}
- Home
- Getting Started
- Pre-requisites
- Installing the module
- Exporting SharePoint Configuration
- Creating Configuration Files
- Pre-created Examples
- Creating an Azure development environment
- Understanding Resources & Syntax
- Remote PowerShell Authentication
- Contributing to SharePointDsc
- Other useful modules for SharePoint DSC configurations