MessageBuilderConfigRelatedFilesFolder Property
Gets or sets the path to the folder from which to take the files related to the message.

Namespace: MailBee.Mime
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 11.2.0 build 590 for .NET 4.5
public string RelatedFilesFolder { get; set; }

Property Value

Type: String
A string containing the path to the folder containing the files related to the message. The default value is an empty string which means the files will be searched in the current folder or in the folder where the HTML file being imported resides.

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="">, 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 Note
MessageBuilderConfig object cannot be used on its own. To access its members, the developer should use MailMessage.Builder property.
This sample creates a new mail message and loads the message body from HTML file. The body charset is set to Windows-1252 and it's allowed to import related files from the local filesystem and from the web. For relative paths, C:\Temp location on the local filesystem will be used as a base path.
// 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";
    ImportBodyOptions.ImportRelatedFiles | 
See Also