MailMessage.ReplyTo NullReferenceException

With Aspose.Network, setting ReplyTo property to null generates a NullReferenceException. This strikes me as a bug given there’s no documentation that explicitly states ReplyTo cannot be null, and it’s not even a required field. However if that is the intended behavior can the exception at least be changed to a ArgumentNullException?


Thanks for considering Aspose.

MailMessage.ReplyTo property is of type MailAddress. So, if null value is assigned, then “System.NullReferenceException - Object reference not set to an instance of an object.” will occur.

And if you assign it as follows:
msg.ReplyTo = “”;
then ArgumentNullException would occur, because overloaded operator method that accepts string to initialize a MailAddress type object.


After doing some some more analysis, we think that assigning MailMessage.ReplyTo to null should not be throwing any exception. We will fix this in future. Sorry for the inconvenience.

The issues you have found earlier (filed as 16271) have been fixed in [this update](

This message was posted using Notification2Forum from Downloads module by aspose.notifier.