Comments (5)
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.
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.
It's working like a champ. Decodes to stream, can work with the attachments, etc. Thank ye!
from mimekit.
Glad it's working out for you!
from mimekit.
MimeKit now has a MimeIterator for walking the tree w/o recursion.
from mimekit.
Related Issues (20)
- HTML base64 to CID conversion HOT 1
- Punycode encoding being improperly used for email local parts HOT 1
- Make more packages conditional based on TFM HOT 3
- Will the order of the `MimeMessage.Attachments` (i.e., `MimeMessage.EnumerateMimeParts`) enumeration be permanent? HOT 1
- Error using smtprelay server.com Port 25. HOT 1
- Could not load file or assembly 'System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51 HOT 1
- The PGP key server query builder omits leading zero(s) in 'keyId' parameter HOT 1
- Problem compiling tag 3.0.0 in x64 HOT 2
- Update BouncyCastle.Cryptography to 2.3.1 HOT 3
- PgpCore / MimeKit? HOT 2
- MimeKitLite not bumped to v4.6.0 on NuGet HOT 1
- SQLite is not available. Install the System.Data.SQLite nuget package. HOT 1
- Setting the attachment code is invalid HOT 12
- MimeKit is parsing address as `GroupAddress` instead of `MailboxAddress` HOT 2
- From returns blank when it contains special characters HOT 6
- Add an image as an in line signature HOT 3
- Mimekit 3.3+ Japanese CP encoding regression? HOT 1
- message/rfc822 attachment with blank Content-Transfer-Encoding header causes attachment to become corrupted when loaded and prepared by mimekit HOT 5
- ERROR: The type initializer for 'PerTypeValues1' threw an exception. HOT 3
- "|" and English cannot be correctly transcoded together HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mimekit.