MessageBuilderConfigOnReplaceUriWithCid Property |
Namespace: MailBee.Mime
using System; using MailBee; using MailBee.Mime; class Sample { static bool SkipSecureResources(string uri) { if (uri.ToLower().StartsWith("https:")) { return false; } return true; } static void Main(string[] args) { MailMessage msg = new MailMessage(); // Set the delegate and import HTML with related resources. All the references starting with "https:" // will be left intact. Other references will be replaced with CIDs generated by MailBee and the files // mentioned by these references will be attaced to the message. Each attachment will have Content-ID // equal to the corresponding CID in the HTML body. msg.Builder.OnReplaceUriWithCid = new ReplaceUriWithCidHandler(SkipSecureResources); msg.LoadBodyText(@"C:\Temp\test.html", MessageBodyType.Html, null, ImportBodyOptions.ImportRelatedFiles | ImportBodyOptions.ImportRelatedFilesFromUris); msg.SaveMessage(@"C:\Temp\test.eml"); } }