MailMessageLoadBodyText Method (String, MessageBodyType) |
Loads the contents of the specified file into HTML or plain-text body of the message.
Namespace: MailBee.MimeAssembly: MailBee.NET (in MailBee.NET.dll) Version: 12.5.0 build 687 for .NET 4.5
Syntax public bool LoadBodyText(
string filename,
MessageBodyType bodyType
)
Public Function LoadBodyText (
filename As String,
bodyType As MessageBodyType
) As Boolean
Parameters
- filename
- Type: SystemString
The absolute or relative path to the file containing the text to be imported. - bodyType
- Type: MailBee.MimeMessageBodyType
Denotes whether to load the data into HTML body or into plain-text body.
Return Value
Type:
Booleantrue if the text was successfully imported; otherwise,
false.
Exceptions Remarks Examples This sample creates a new message and loads HTML body from .HTM file.
using MailBee;
using MailBee.Mime;
MailMessage msg = new MailMessage();
msg.LoadBodyText(@"C:\Temp\web_page.htm", MessageBodyType.Html);
msg.SaveMessage(@"C:\Temp\msg.eml");
Imports MailBee
Imports MailBee.Mime
Dim msg As New MailMessage
msg.LoadBodyText("C:\Temp\web_page.htm", MessageBodyType.Html)
msg.SaveMessage("C:\Temp\msg.eml")
See Also