views:

131

answers:

1

I have set up Microsoft SMTP server so it will store all incoming email in a dropfolder.

I want to process, using c#, incoming mail based on the sender, recipient, and subject line. If possible, I also want to create a plain text preview of the email.

So, there are two parts to this problem.

  1. I'm guessing a FileSystemWatcher would be adequate for providing notification of incoming mail.
  2. How to parse the headers and body text from the .eml file; is there an existing library or any good documentation on the format?

Thanks for any help.

A: 
  1. Yes - thats true
  2. I used this: http://www.lumisoft.ee/lswww/ENG/Products/Mail%5FServer/mail%5Findex%5Feng.aspx?type=info

It's a Mailserver written in C# with an API you can use without using the Mailserver

EDIT: Found a code snippet:

LumiSoft.Net.Mime.Mime m = LumiSoft.Net.Mime.Mime.Parse(mailfile);
Console.WriteLine("Read message from: " + m.MainEntity.From);
Console.WriteLine("To: " + m.MainEntity.To[0]);
Arthur
Thanks, I'd prefer not to replace the SMTP server though
wefwfwefwe
As I wrote: You do not have to replace your mailserver - just use their Mime classes to parse mails.
Arthur