Sending Custom HTML Emails with PowerShell

Mark Harwood
4 min readJun 3, 2021

Hi Everyone,

Today I wanted to show you my preferred way of sending custom HTML emails with PowerShell. There a ton of benefits to doing it this way. One of my favourites is the fact that you can embed images into the email rather than host them on a separate website.

I hope COVID restrictions are starting to ease for you all. Still, don’t want to let your guard down too much, ey! Better safe than sorry.

This article is also available on Medium if you prefer to read over there. You can find the link here!

Why bother ‘Sending Custom HTML Emails with PowerShell’?

The main issue with using custom HTML emails, is that HTML shows differently on every single device. This can result in your emails looking different with different email applications.

Outlook is particularly bad for displaying HTML in a uniform way. It often completely ignores the header which is often used to contain styling and CSS information. So the only way I’ve found around this is to include the styling on every single HTML element in the HTML body. This is far from ideal and takes a ton of time compared to header CSS styling.

The HTML Code

--

--

Mark Harwood

IT Pro 👨‍💻 Dad 👀 Husband🔒 Check out my free blog or utilise my expertise on the web! https://mharwood.uk