MailMessageSerialize Method (XmlWriter) |
Saves the message into XML stream using the specified
XmlWriter object.
Namespace: MailBee.MimeAssembly: MailBee.NET (in MailBee.NET.dll) Version: 12.5.0 build 687 for .NET 4.5
Syntax public bool Serialize(
XmlWriter xmlWriter
)
Public Function Serialize (
xmlWriter As XmlWriter
) As Boolean
Parameters
- xmlWriter
- Type: System.XmlXmlWriter
An XmlWriter object.
Return Value
Type:
Booleantrue if the message was successfully saved to .XML file; otherwise,
false.
Exceptions Remarks Examples This sample loads the message from .EML file and saves this message to .XML file.
using System.Xml;
using System.Text;
using MailBee;
using MailBee.Mime;
MailMessage msg = new MailMessage();
msg.LoadMessage(@"C:\Docs\TestMail.eml");
XmlTextWriter xtw = null;
try
{
xtw = new XmlTextWriter(@"C:\Temp\msg.xml", Encoding.UTF8);
msg.Serialize(xtw);
}
finally
{
if (xtw != null) xtw.Close();
}
Imports System.Xml
Imports System.Text
Imports MailBee
Imports MailBee.Mime
Dim msg As New MailMessage
msg.LoadMessage("C:\Docs\TestMail.eml")
Dim xtw As XmlTextWriter = Nothing
Try
xtw = New XmlTextWriter("C:\Temp\msg.xml", Encoding.UTF8)
msg.Serialize(xtw)
Finally
If Not xtw Is Nothing Then
xtw.Close()
End If
End Try
See Also