I call this to open the msg:
msg = MapiMessage.FromFile
then call this:
var printer = new Aspose.Email.Printing.MailPrinter();
printer.Print(msg, parent.oFilename, Aspose.Email.Printing.PrintFormat.XPS);
but the Print call throws this exception:
System.ArgumentNullException was unhandled
HResult=-2147467261
Message=String reference not set to an instance of a String.
Parameter name: s
Source=mscorlib
ParamName=s
StackTrace:
at System.Text.Encoding.GetBytes(String s)
at . (String )
at . (MapiMessage )
at . (MapiMessage , Stream )
at Aspose.Email.Printing.MailPrinter.Print(MapiMessage message, Stream outputStream, PrintFormat printingFormat)
at Aspose.Email.Printing.MailPrinter.Print(MapiMessage message, String outputFile, PrintFormat printingFormat)
The destination path in parent.oFilename is a legitimate path. The exception occurs because msg.Body is null. If I assign a string containing a single space to msg.Body then there is no exception.