Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide an API to stream messages, instead of loading them into memory #20

Open
manuco opened this issue Jun 28, 2017 · 0 comments
Open
Labels
🚀 feature something that would be nice

Comments

@manuco
Copy link

manuco commented Jun 28, 2017

Today, the aiosmtplib only accepts email body as string or bytes. It means that the mail should be completly loaded in memory before begining to send it.

With asyncio, it is very easy to work with streams (generated on the fly, read from files, pipes, sockets, etc). Moreover, if we want to send more that a few emails, we should either send them sequentially or load all of them in memory. In either case, we loose one of the feature of async programmming.

It would be nice to support email bodies as something else than just static buffers (string or bytes). Have a look at the aiohttp multipart module (http://aiohttp.readthedocs.io/en/stable/multipart.html). It enables to build a MIME Multipart body by attaching string, bytes, but also HTTP Responses, streams, etc. The content is serialized on the fly when using the object, and can be streamed to a socket or the standard output.

It would be nice to allow a streamable object as a message body, allowing not to load the content completly into memory while sending it.

@cole cole added this to the 1.1.0 milestone Jul 14, 2017
@cole cole added the 🚀 feature something that would be nice label Jul 14, 2017
@cole cole modified the milestones: 1.1.0, 2.0 Jan 14, 2019
Repository owner deleted a comment from cole-orc Nov 5, 2019
@cole cole self-assigned this Aug 1, 2020
@cole cole removed their assignment Apr 1, 2021
@cole cole removed this from the 2.0 milestone Apr 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚀 feature something that would be nice
Projects
None yet
Development

No branches or pull requests

2 participants