When using Aspose.Email 2.6.0, if you attempt to print a draft message from a PST using the MailPrinter, it is possible to get a null reference exception because the From address of the message is null.
As a workaround, you can explicitly set the From property on the message to something before printing, but we would prefer the MailPrinter to just leave this field empty if the From address is null.
Using the attached .MSG, the issue can be reproduced with this code:
var mm = MailMessage.Load(source);
var printer = new MailPrinter() { FormattingFlags = MessageFormattingFlags.MailInfo };
printer.Print(mm, dest, PrintFormat.XPS);
which throws:
System.NullReferenceException
at . .Print(MailMessage , Stream )
at . .Print(MailMessage , Stream )
at Aspose.Email.Printing.MailPrinter.Print(MailMessage message, Stream outputStream, PrintFormat printingFormat)
at Aspose.Email.Printing.MailPrinter.Print(MailMessage message, String outputFile, PrintFormat printingFormat)
I have analyzed the information and have reproduced the issue here successfully. I have logged this bug in our issue tracking system as NETWORKNET-33632. You will be notified as soon as some feedback is received from developers in this regard.
Please feel free to write us back if you have any other query in this regard.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.