MailMessageLoadBodyTextAsync Method (String, MessageBodyType, Encoding, ImportBodyOptions)

Namespace: MailBee.Mime
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 12.4 build 677 for .NET 4.5
Syntax
public Task<bool> LoadBodyTextAsync(
	string path,
	MessageBodyType bodyType,
	Encoding sourceEncoding,
	ImportBodyOptions options
)

Parameters

path
Type: SystemString
The path to the file containing the text to be loaded into the message body. This path can be an URI (such as web page URL or file path specified as file:///) if options value includes PathIsUri flag.
bodyType
Type: MailBee.MimeMessageBodyType
Denotes whether to load the data into HTML body or into plain-text body.
sourceEncoding
Type: System.TextEncoding
The charset of the data in the file being loaded. If a null reference (Nothing in Visual Basic), DefaultEncoding will be assumed (unless the charset information is available in META tag of the HTML data being loaded).
options
Type: MailBee.MimeImportBodyOptions
A set of flags which affect how the data is loaded from the file into the message body and whether (and how) the related objects should be attached.

Return Value

Type: TaskBoolean
A task that represents the asynchronous operation. The value of TResult parameter is true if succeeded; otherwise, false.
Exceptions
ExceptionCondition
MailBeeInvalidArgumentExceptionpath is a null reference (Nothing in Visual Basic) or an empty string.
MailBeeWebExceptionA downloading error occurred and ThrowExceptions is true.
MailBeeIOExceptionAn I/O error occurred and ThrowExceptions is true.
See Also