简体   繁体   中英

Validating EML files in C#

In my application, I need to validate if a particular file has a correct EML format. I thought about opening the file and check if it has the correct headers (subject,body,etc) but I'd like to know if there is a standard approach for this in C#.

For the record, the file could end with any possible extension and I don't intend to do anything special with the file, I just need to verify that the file is in a valid EML format.

Easily Retrieve Email Information from .EML Files

Here it is in a wrapper class, all nice and tidy. This comes in real handy if you have a service that needs information that is emailed to the box. It has the usual "To", "CC" fields, along with a collection of x-receiver and many other fields. It will give you both plain text and HTML bodies, provided they are in the EML. Dates are converted to DateTime.

http://www.codeproject.com/Articles/29439/Easily-Retrieve-Email-Information-from-EML-Files

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM