Are there .NET Framework methods to parse an email (MIME)?

前端 未结 6 1559
遇见更好的自我
遇见更好的自我 2020-12-02 19:12

Is there a class or set of functions built into the .NET Framework (3.5+) to parse raw emails (MIME documents)?

I am not looking for anything fancy or a separate lib

6条回答
  •  猫巷女王i
    2020-12-02 19:50

    Check out Mail.dll .NET mail component, it has build in MIME support, unicode, and multi-national email support:

    MailBuilder builder = new MailBuilder();
    
    // Here you get the message class with attachments, visuals
    IMail message = builder.CreateFromEml(File.ReadAllText("test.eml"));
    
    // you can access entire MIME document:
    MimeDocument document = message.Document;
    

    Please note that Mail.dll is a commercial product that I've created.

    You can download it here: https://www.limilabs.com/mail.

提交回复
热议问题