MessageBuilderConfigRelatedFilesFolder Property |
Namespace: MailBee.Mime
MailBee uses this property value when importing files denoted by relative paths only. For absolute paths, this property is NOT used. For instance, if certain <IMG> tag looks like <IMG SRC="C:\Pictures\1.jpg">, <IMG SRC="file:///C:/Docs/picture.gif"> or <IMG SRC="http://www.company.com/logo.png">, it contains absolute path, not relative. Examples of relative paths are <IMG SRC="logo.png">, <IMG SRC="/picture.gif">, <IMG SRC="subfolder\logo.png">. In other words, a relative path does not contain the entire path. To constuct the entire path, the relative path needs to be prepended with certain base path. If this base path is not the current folder in your case, you need to specify it in this property.
RelatedFilesFolder may contain an URI (URL) as well as a local filesystem path. In this case, MailBee will assume that relative paths lead to the resources located on the web.
RelatedFilesFolder property will have effect only if it is set BEFORE related files get imported. The methods which may import them are LoadBodyText(String, MessageBodyType, Encoding, ImportBodyOptions) and ImportRelatedFiles(ImportRelatedFilesOptions).
Note |
---|
MessageBuilderConfig object cannot be used on its own. To access its members, the developer should use MailMessage.Builder property. |
// To use the code below, import these namespaces at the top of your code. using System.Text; using MailBee; using MailBee.Mime; MailMessage newMsg = new MailMessage(); newMsg.Builder.RelatedFilesFolder = @"C:\Temp"; newMsg.LoadBodyText(@"C:\Docs\TestMail.htm", MessageBodyType.Html, Encoding.GetEncoding("Windows-1252"), ImportBodyOptions.ImportRelatedFiles | ImportBodyOptions.ImportRelatedFilesFromUris);