We have gone through quite a lot! Our simple e-mail script grew into something quite sophisticated. The final script can now do the following:
Send both plain text and HTML e-mail.
Handle multiple recipients.
Support carbon copying and blind carbon copying.
Set message priority and Reply-To address.
Add custom headers and support message read receipts.
Attach files to the message.
Embed media files in HTML-formatted messages.
The beauty of it all is that our script library, mailutils-final.ps1, contains less than 100 lines of script. The driver script, send-mail-final.ps1, is about 20 lines long and just calls functions from the script library. We got every feature from the preceding list for a mere 120 lines of code--talk ...