# Email Chart Image

Email Chart Image on Evotec with practical examples, usage guidance, and reusable project workflows.

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)

Stars**1024**

Forks**115**

Open issues**0**

PowerShell Gallery downloads**7576901**

Release**v1.45.0**

Language: PowerShell Updated: 2026-11-19

Curated Examples

An example script from the PSWriteHTML repository.

- Source repository: [https://github.com/EvotecIT/PSWriteHTML](https://github.com/EvotecIT/PSWriteHTML)
- Example group: `Example-Emails`

```powershell
# Requires ImagePlayground 3.2.7 or later. Install it with Install-Module ImagePlayground.
[CmdletBinding()]
param(
    [string] $OutputDirectory = (Join-Path ([IO.Path]::GetTempPath()) 'PSWriteHTML-ChartEmail')
)

$ErrorActionPreference = 'Stop'
Import-Module ImagePlayground -MinimumVersion 3.2.7
Import-Module (Join-Path $PSScriptRoot '../../PSWriteHTML.psd1') -Force

$null = New-Item -Path $OutputDirectory -ItemType Directory -Force
$ChartPath = Join-Path $OutputDirectory 'ServiceHealth.png'
$PreviewPath = Join-Path $OutputDirectory 'ServiceHealth-email.html'

# Render the PNG directly from the report data.
$null = New-ImageChart {
    New-ImageChartBar -Label 'Healthy' -Value 18 -Color MediumSeaGreen
    New-ImageChartBar -Label 'Warning' -Value 3 -Color Orange
    New-ImageChartBar -Label 'Failed' -Value 1 -Color IndianRed
} -FilePath $ChartPath -Width 720 -Height 420 -ShowGrid

# Use this HTML body with your mail transport. The example only saves a local preview.
$EmailHtml = EmailBody {
    EmailText -Text 'Service health summary'
    EmailImage -Source $ChartPath -Inline -Width 540 -Height 315 `
        -AlternativeText 'Service health: 18 healthy, 3 warnings, 1 failure'
    EmailText -Text '18 healthy, 3 warnings, 1 failure.'
}
Save-HTML -FilePath $PreviewPath -HTML $EmailHtml
```

<!-- PowerForge markdown artifact sha256:36C8692B5DE9A2450B8F377CCC935471075ED687FDEA14D685865DF5A45DBC92 -->
