GithubHelp home page GithubHelp logo

Comments (5)

mwpowellhtx avatar mwpowellhtx commented on July 19, 2024

I don't know whether you can leverage existing classes and avoid having to reinvent the wheel: see also System.Net.Mail.Attachment, System.Net.Mail.AttachmentCollection, and so on.

from mimekit.

jstedfast avatar jstedfast commented on July 19, 2024

Yes, you can make any recursive solution into an iterative one by creating your own stack, but what's the point of that?

I added the Attachments convenience property because it was clear you didn't understand how MIME actually works. MIME is not a list, it's a tree. The Attachments and BodyParts properties are there for people who don't want to traverse the tree themselves.

Second, I am concerned that EnumerateMimeParts occurs multiple times depending on the property(ies) that are called. It doesn't need to be calculated any more than once, regardless the caller requesting the parts. The parts aren't changing between calls, after all... It's only "two" properties, BodyParts and Attachments, but you get the idea.

That comment doesn't even make sense. They are simply convenience APIs to iterate over a tree of parts and treat them like an iterative list for people who are too lazy to do things properly.

Then... What's the point of Attachments if they aren't streamable? The parts still need to be assembled and presented through a memory stream?

Huh???

Why do you think they need to be assembles or presented through a memory stream??

That doesn't even make sense.

A MimeKit.MimePart object is a leaf-node part, which are the only parts that can contain content. You want to "stream" the content? That's great. I have 2 APIs for that:

MimePart.ContentObject.Open() or MimePart.ContentObject.DecodeTo(Stream)

There's also MimePart.ContentObject.WriteTo(Stream) if you'd prefer to write the encoded data.

What is it that you want to stream that you think you can't stream? MimeKit is designed around the idea of streaming.

from mimekit.

mwpowellhtx avatar mwpowellhtx commented on July 19, 2024

It's working like a champ. Decodes to stream, can work with the attachments, etc. Thank ye!

from mimekit.

jstedfast avatar jstedfast commented on July 19, 2024

Glad it's working out for you!

from mimekit.

jstedfast avatar jstedfast commented on July 19, 2024

MimeKit now has a MimeIterator for walking the tree w/o recursion.

from mimekit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.