Command
EmailServer
Defines the email server configuration for sending emails.
Syntax
EmailServer [[-Password] <String>] [-PasswordAsSecure] [-PasswordFromFile] [[-Port] <Int32>] [[-Server] <String>] [-SSL] [-UseDefaultCredential] [[-UserName] <String>] [<CommonParameters>]#Parameter set:
All Parameter SetsDescription
This function sets up the email server configuration including server address, port, authentication credentials, and SSL settings.
Examples
EXAMPLE 1
EmailServer -Server "mail.example.com" -Port 587 -UserName "user@example.com" -Password "P@ssw0rd" -SSL
Configures the email server with the specified server address, port, username, password, and SSL enabled.Parameters
- -Password String
- Specifies the password for authentication with the email server.
- -PasswordAsSecure SwitchParameter
- Indicates that the password should be treated as a secure string.
- -PasswordFromFile SwitchParameter
- Indicates that the password should be read from a file.
- -Port Int32
- Specifies the port number of the email server. Default is 587.
- -Server String
- Specifies the address of the email server.
- -SSL SwitchParameter
- Indicates whether SSL should be used for the connection.
- -UseDefaultCredential SwitchParameter
- Specifies whether to use default credentials for authentication.
- -UserName String
- Specifies the username for authentication with the email server.
Common Parameters
This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.
For more information, see about_CommonParameters.