Elegant way to serialize a MailMessage object in .NET
问题 I'm currently looking at serializing a MailMessage object in C# and although there are a couple of variations of an example on the net, they serialize to binary which kind of misses the point IMO. My approach is that I'd like to serialize a MailMessage to an RFC2822 eml string and the code below is what I've come up with. public string SerializeEmail(MailMessageArgs e) { string rfc822eml = ""; Guid g = Guid.NewGuid(); lock (g.ToString()) { System.IO.DirectoryInfo di = new System.IO