# Email

Sends an email with specified parameters. Review available syntax, parameters, pipeline guidance, and reference details in PSWriteHTML API Reference.

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`

Sends an email with specified parameters.

## Syntax

```
Email
[-AttachSelf]
[-AttachSelfName <String>]
[-BCC <String[]>]
[-CC <String[]>]
[-DeliveryNotifications <OnSuccess|OnFailure|Delay|Never>]
[[-Email] <ScriptBlock>]
[-Encoding <String>]
[-FilePath <String>]
[-From <String>]
[-Online]
[-OutputHTML]
[-Password <String>]
[-PasswordAsSecure]
[-PasswordFromFile]
[-Port <Int32>]
[-Priority <Low|Normal|High>]
[-ReplyTo <String>]
[-Server <String>]
[-SSL]
[-Subject <String>]
[-Suppress <Boolean>]
[-To <String[]>]
[-Username <String>]
[<CommonParameters>]
```

[#](#member-ac449d38d8049a59edc02320)

Parameter set: `All Parameter Sets`

## Description

This function sends an email with the provided parameters including recipients, subject, content, and server settings.

## Guides & Samples

Authored walkthroughs and practical samples linked to this command.

- [Curated PSWriteHTML examples](/projects/pswritehtml/examples/) Example
  
  Website-ready examples for common PSWriteHTML usage patterns.

## Examples

### Example 1

```powershell
Email -FilePath 'C:\Path'
```

## Parameters

**-AttachSelf SwitchParameter optionalaliases: SelfAttach**

Switch parameter to attach the email to itself.

**-AttachSelfName String optional**

Specifies the name of the attached email.

**-BCC String[] optional**

Specifies the email addresses of the blind carbon copy recipients.

**-CC String[] optional**

Specifies the email addresses of the carbon copy recipients.

**-DeliveryNotifications Object optional**

Specifies the type of delivery notifications. Valid values are 'None', 'OnSuccess', 'OnFailure', 'Delay', or 'Never'. Default is 'None'.

Possible values: `OnSuccess`, `OnFailure`, `Delay`, `Never`

**-Email ScriptBlock optionalposition: 0**

Specifies the ScriptBlock containing the email content and additional parameters.

**-Encoding String optional**

[Obsolete] Deprecated parameter. Encoding is set to UTF8 to prevent errors.

**-FilePath String optional**

Specifies the file path for attachments.

**-From String optional**

Specifies the email address of the sender.

**-Online SwitchParameter optional**

Switch parameter to send the email online without saving it.

**-OutputHTML SwitchParameter optional**

Switch parameter to output the email content as HTML.

**-Password String optional**

Specifies the password for authentication with the SMTP server.

**-PasswordAsSecure SwitchParameter optional**

Switch parameter to treat the password as a secure string.

**-PasswordFromFile SwitchParameter optional**

Switch parameter to indicate that the password is read from a file.

**-Port Int32 optional**

Specifies the port number for the SMTP server. Default is 587.

**-Priority String optional**

Specifies the priority of the email. Valid values are 'Low', 'Normal', or 'High'. Default is 'Normal'.

Possible values: `Low`, `Normal`, `High`

**-ReplyTo String optional**

Specifies the email address to set as the reply-to address.

**-Server String optional**

Specifies the SMTP server for sending the email.

**-SSL SwitchParameter optional**

Switch parameter to enable SSL for the SMTP connection.

**-Subject String optional**

Specifies the subject of the email.

**-Suppress Boolean optionalaliases: Supress**

Switch parameter to suppress sending the email.

**-To String[] optional**

Specifies the email addresses of the primary recipients.

**-Username String optional**

Specifies the username for authentication with the SMTP 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:88D20DE15771B6A43D202C246078F0BFADDA8ED6E4AFC67CB651A6BE2358D534 -->
