1

Can someone guide me towards implementing the IDataContractSurrogate for the MailMessage class in .Net Framework?

I'm currently trying to pass the MailMessage class as an object and it doesn't work...it throws the following exception...

Type 'System.Net.Mail.MailAddress' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute. See the Microsoft .NET Framework documentation for other supported types.

I would appreciate any help...

Thanks so much!!

Josh
  • 13,530
  • 29
  • 114
  • 159
  • 1
    http://msdn.microsoft.com/en-us/library/system.runtime.serialization.idatacontractsurrogate.aspx – Jaroslav Jandek Jul 21 '10 at 09:25
  • I've seen that but I still can't figure out how to use the same concept for this object. In that example,they have control over the person class....over here I don't.. so,whats the solution? – Josh Jul 21 '10 at 09:40

0 Answers0