MailUtils.NET - MimeKit / System.Net.Mail + Embedded pictures

This solution is from an era, where MimeKit was not a standard yet in .NET and mostly System.Net.Mail was used.

There were 2 things we had to solve:

  1. embedding pictures into the email (not as attachments but as a viewable part of the HTML body
  2. and enforcing security (which required the switch to MimeKit as System.Net.Mail supports connections on port 587 (default port for Explicit SSL that starts unencrypted then issues a STARTTLS then switches to an Encrypted connection: RFC 2228, but doesn't support Implicit SSL (entire connection is wrapped in an SSL layer...

...both of them are addressed inside this solution

NOTE: back then AngleSharp wasn't available yet (it's a 2013 project, while MimeKit is from 2012) so for some HTML parsing I've used RegEx plus assumed XML/XHTML document and used XmlDocument for parsing...