I’d like to setup a WCF service to send emails. The System.Net.MailMessage doesn’t seem to be serializable, and cannot be passed in a [DataContract]
The error I receive is
Type ‘System.Net.Mail.MailAddress’ cannot be serialized. Consider marking it with the DataContractAttribute
Any suggestions?
Whatever you pass to a WCF service needs to be either XML or binary serializable.
A ‘classic’ messaging approach would be: