# EmailServer

Defines the email server configuration for sending emails.

Project

PSWriteHTML

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

[View on GitHub](https://github.com/EvotecIT/PSWriteHTML) [Visit Website](#) [Releases](https://github.com/EvotecIT/PSWriteHTML/releases/tag/v1.41.0) [Changelog](#) [Get package](https://www.powershellgallery.com/packages/PSWriteHTML/1.40.0)

Stars **1,025**

Forks **114**

Open issues 

PowerShell Gallery downloads **7,576,901**

Release **v1.45.0**

Language: PowerShell Updated: 2026-11-19

Command 

**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>]
```

[#](#method-emailserver-string-switchparameter-switchparameter-int32-string-switchparameter-switchparameter-string)

Parameter set: `All Parameter Sets`

## Description

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

## Examples

### Example 1

```powershell
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](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_commonparameters).

Evotec API Reference Copyright 2026 Evotec Services

<!-- PowerForge markdown artifact sha256:C84F4772BB8B5D9B333D5D79153042146149DC710E1C5593FDFAA29EB2638480 -->
