MailBee.NET Objects 3.1

MailMessage.Serialize Method (String)

Saves the message into the specified .XML file.

public bool Serialize(
   string filename
);

Parameters

filename
The path to the .XML file to be saved.

Return Value

true if the message was successfully saved to .XML file; otherwise, false.

Remarks

The saved message can be loaded back with Deserialize method.

Exceptions

Exception Type Condition
MailBeeInvalidArgumentException filename is a null reference (Nothing in Visual Basic) or an empty string.
MailBeeIOException An I/O error occurred and ThrowExceptions is true.

Example

The example is available in Deserialize method documentation.

See Also

MailMessage Class | MailBee.Mime Namespace | MailMessage.Serialize Overload List | Deserialize