Project

PSWriteHTML

Generate HTML reports, dashboards, and emails from PowerShell without writing HTML, CSS, or JavaScript.

Stars 1,019
Forks 115
Open issues 54
PowerShell Gallery downloads 7,576,901
Release v1.41.0
Language: PowerShell Updated: 2026-10-03
Command

EmailServer

Module PSWriteHTML

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 Sets

Description

This function sets up the email server configuration including server address, port, authentication credentials, and SSL settings.

Examples

Authored help example

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 optionalposition: 3
Specifies the password for authentication with the email server.
-PasswordAsSecure SwitchParameter optional
Indicates that the password should be treated as a secure string.
-PasswordFromFile SwitchParameter optional
Indicates that the password should be read from a file.
-Port Int32 optionalposition: 1
Specifies the port number of the email server. Default is 587.
-Server String optionalposition: 0
Specifies the address of the email server.
-SSL SwitchParameter optional
Indicates whether SSL should be used for the connection.
-UseDefaultCredential SwitchParameter optionalaliases: UseDefaultCredentials
Specifies whether to use default credentials for authentication.
-UserName String optionalposition: 2
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.