I have a PowerShell script that generates an HTML file named email.html
. This file contains inline CSS and base64 encoded images, and it is sent to me daily as part of my website reports.
I would like all the content (text/images) in the body of this email to automatically resize based on the width of the email client's viewable area. I must admit that I have limited experience with HTML/CSS. Can you point out what I am doing wrong in the code snippet below? Please note that I have shortened the base64 text for the sake of brevity.
Code:
<!doctype html>
<html>
<head>
<style type="text/css">
@media screen and (max-device-width:640px),
screen and (max-width:640px) {
.responsivetext {font-size: 2vw !important;width:auto;height:auto;vertical-align:middle}
}
</style>
</head>
<body>
<td style="font-family: Arial;" class="responsivetext">I have tried everything. Why wont this text resize when resizing Outlook 2016?</td>
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAIEAIAAADwyk6cAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABmJLR0T...." />
</body>
</html>