magic.lambda.mime
15.9.1
dotnet add package magic.lambda.mime --version 15.9.1
NuGet\Install-Package magic.lambda.mime -Version 15.9.1
<PackageReference Include="magic.lambda.mime" Version="15.9.1" />
paket add magic.lambda.mime --version 15.9.1
#r "nuget: magic.lambda.mime, 15.9.1"
// Install magic.lambda.mime as a Cake Addin
#addin nuget:?package=magic.lambda.mime&version=15.9.1
// Install magic.lambda.mime as a Cake Tool
#tool nuget:?package=magic.lambda.mime&version=15.9.1
magic.lambda.mime - Creating and parsing MIME messages from Hyperlambda
magic.lambda.mime gives you the ability to parse and create MIME messages from Hyperlambda. This project contains the following slots.
- [mime.parse] - Parses a MIME message, and returns it as a lambda object
- [mime.create] - Creates a MIME message for you, and returns the entire message as text, being the MIME entity
- [.mime.parse] - Parses a native MimeEntity for you, and returns it as a lambda object (not for usage directly from Hyperlambda code)
- [.mime.create] - Creates a MIME message for you, and returns it as a native MimeEntity object (not for usage directly from Hyperlambda code)
How to use [mime.parse]
Below is an example of how parsing a MIME message might look like using [mime.parse].
// Actual message
.msg:"Content-Type: multipart/mixed; boundary=\"=-3O9TzEjuVDwt7d5uGDkV/Q==\"\n\n--=-3O9TzEjuVDwt7d5uGDkV/Q==\nContent-Type: text/plain\nContent-Disposition: attachment; filename=README.md\n\n# Your dynamic files folder\n\nSome README.md file\n\n--=-3O9TzEjuVDwt7d5uGDkV/Q==\nContent-Type: text/plain\n\nBar\n--=-3O9TzEjuVDwt7d5uGDkV/Q==--\n"
// Parsing the above message
mime.parse:x:@.msg
After evaluating the above, you'll end up with something resembling the following.
mime.parse:multipart/mixed
entity:text/plain
headers
Content-Disposition:attachment; filename=README.md
content:"# Your dynamic files folder\n\nSome README.md file\n"
entity:text/plain
content:Bar
Notice how the slot creates a tree structure, perfectly resembling your original MIME message. It will also take care of MIME headers for you, adding these into a [headers] collection, on a per MIME entity basis, depending upon whether or not your message actually contains headers or not.
How to use [mime.create]
The [mime.create] slot is logically the exact opposite of the [mime.parse] slot, and can take (almost) the exact same input as its sibling produces as output. Below is an example.
mime.create:multipart/mixed
structured:false
entity:text/plain
content:this is the body text
entity:text/plain
content:this is another body text
Which of course wil result in something resembling the following after evaluation.
mime.create:"Content-Type: multipart/mixed; boundary=\"=-7+NI+p6PuOyQUzW5ihnXvw==\"\n\n--=-7+NI+p6PuOyQUzW5ihnXvw==\nContent-Type: text/plain\n\nthis is the body text\n--=-7+NI+p6PuOyQUzW5ihnXvw==\nContent-Type: text/plain\n\nthis is another body text\n--=-7+NI+p6PuOyQUzW5ihnXvw==--\n"
Notice - If you set its [structured] argument to boolean true
, the slot will return the MIME envelope headers
for the outermost MIME entity "detached" from the rest of the message. This is useful when you for some reasons don't want
the headers for the outermost entity to be a part of the actual message, such as for instance when creating multipart/form-data
types of messages you need to transmit to some HTTP endpoint. If you do this, the return after executing the slot will
resemble the following.
mime.create
Content-Type:"multipart/mixed; boundary=\"=-EbMBZ3eHrSrMqtB2KHSv+A==\""
content:"--=-EbMBZ3eHrSrMqtB2KHSv+A==\nContent-Type: text/plain\n\nthis is the body text\n--=-EbMBZ3eHrSrMqtB2KHSv+A==\nContent-Type: text/plain\n\nthis is another body text\n--=-EbMBZ3eHrSrMqtB2KHSv+A==--\n"
Project website for magic.lambda.mime
The source code for this repository can be found at github.com/polterguy/magic.lambda.mime, and you can provide feedback, provide bug reports, etc at the same place.
Product | Versions |
---|---|
.NET | net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows net7.0 net7.0-android net7.0-ios net7.0-maccatalyst net7.0-macos net7.0-tvos net7.0-windows |
.NET Core | netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1 |
.NET Standard | netstandard2.0 netstandard2.1 |
.NET Framework | net461 net462 net463 net47 net471 net472 net48 net481 |
MonoAndroid | monoandroid |
MonoMac | monomac |
MonoTouch | monotouch |
Tizen | tizen40 tizen60 |
Xamarin.iOS | xamarinios |
Xamarin.Mac | xamarinmac |
Xamarin.TVOS | xamarintvos |
Xamarin.WatchOS | xamarinwatchos |
-
.NETStandard 2.0
- magic.node.extensions (>= 15.9.1)
- magic.signals.contracts (>= 15.9.1)
- MimeKit (>= 3.0.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on magic.lambda.mime:
Package | Downloads |
---|---|
magic.library
Helper project for Magic to wire up everything easily by simply adding one package, and invoking two simple methods. When using Magic, this is (probably) the only package you should actually add, since this package pulls in everything else you'll need automatically, and wires up everything sanely by default. To use package go to https://polterguy.github.io |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
15.9.1 | 158 | 3/27/2023 |
15.9.0 | 191 | 3/24/2023 |
15.8.2 | 218 | 3/20/2023 |
15.7.0 | 115 | 3/6/2023 |
15.5.0 | 906 | 1/28/2023 |
15.2.0 | 374 | 1/18/2023 |
15.1.0 | 893 | 12/28/2022 |
14.5.7 | 444 | 12/13/2022 |
14.5.5 | 534 | 12/6/2022 |
14.5.1 | 407 | 11/23/2022 |
14.5.0 | 356 | 11/18/2022 |
14.4.5 | 433 | 10/22/2022 |
14.4.1 | 438 | 10/22/2022 |
14.4.0 | 384 | 10/17/2022 |
14.3.1 | 835 | 9/12/2022 |
14.3.0 | 389 | 9/10/2022 |
14.1.3 | 666 | 8/7/2022 |
14.1.2 | 410 | 8/7/2022 |
14.1.1 | 408 | 8/7/2022 |
14.0.14 | 453 | 7/26/2022 |
14.0.12 | 434 | 7/24/2022 |
14.0.11 | 428 | 7/23/2022 |
14.0.10 | 430 | 7/23/2022 |
14.0.9 | 439 | 7/23/2022 |
14.0.8 | 507 | 7/17/2022 |
14.0.5 | 570 | 7/11/2022 |
14.0.4 | 536 | 7/6/2022 |
14.0.3 | 477 | 7/2/2022 |
14.0.2 | 438 | 7/2/2022 |
14.0.0 | 557 | 6/25/2022 |
13.4.0 | 1,486 | 5/31/2022 |
13.3.4 | 1,053 | 5/9/2022 |
13.3.0 | 673 | 5/1/2022 |
13.2.0 | 843 | 4/21/2022 |
13.1.0 | 741 | 4/7/2022 |
13.0.0 | 481 | 4/5/2022 |
11.0.5 | 1,010 | 3/2/2022 |
11.0.4 | 528 | 2/22/2022 |
11.0.3 | 543 | 2/9/2022 |
11.0.2 | 566 | 2/6/2022 |
11.0.1 | 527 | 2/5/2022 |
10.0.21 | 520 | 1/28/2022 |
10.0.20 | 518 | 1/27/2022 |
10.0.19 | 540 | 1/23/2022 |
10.0.18 | 510 | 1/17/2022 |
10.0.15 | 637 | 12/31/2021 |
10.0.14 | 372 | 12/28/2021 |
10.0.7 | 986 | 12/22/2021 |
10.0.5 | 506 | 12/18/2021 |
10.0.2 | 415 | 12/14/2021 |
10.0.0 | 404 | 12/6/2021 |
9.9.9 | 896 | 11/29/2021 |
9.9.8 | 227 | 11/27/2021 |
9.9.3 | 672 | 11/9/2021 |
9.9.2 | 514 | 11/4/2021 |
9.9.0 | 637 | 10/30/2021 |
9.8.9 | 614 | 10/29/2021 |
9.8.7 | 580 | 10/27/2021 |
9.8.6 | 538 | 10/27/2021 |
9.8.5 | 586 | 10/26/2021 |
9.8.0 | 1,093 | 10/20/2021 |
9.7.9 | 516 | 10/19/2021 |
9.7.5 | 1,168 | 10/14/2021 |
9.7.0 | 737 | 10/9/2021 |
9.6.6 | 295 | 8/14/2021 |
9.5.3 | 2,635 | 7/20/2021 |
9.2.0 | 3,359 | 5/26/2021 |
9.1.4 | 1,014 | 4/21/2021 |
9.1.0 | 797 | 4/14/2021 |
9.0.0 | 734 | 4/5/2021 |
8.9.9 | 884 | 3/30/2021 |
8.9.3 | 1,336 | 3/19/2021 |
8.9.2 | 899 | 1/29/2021 |
8.9.1 | 917 | 1/24/2021 |
8.9.0 | 1,007 | 1/22/2021 |
8.6.9 | 2,623 | 11/8/2020 |
8.6.6 | 1,649 | 11/2/2020 |
8.6.0 | 3,389 | 10/28/2020 |
8.5.0 | 1,640 | 10/23/2020 |
8.4.0 | 4,701 | 10/13/2020 |
8.3.1 | 2,334 | 10/5/2020 |
8.3.0 | 1,129 | 10/3/2020 |
8.2.2 | 1,761 | 9/26/2020 |
8.2.1 | 1,152 | 9/25/2020 |
8.2.0 | 1,072 | 9/25/2020 |
8.1.18 | 378 | 9/24/2020 |
8.1.17 | 6,056 | 9/13/2020 |
8.1.16 | 447 | 9/13/2020 |
8.1.15 | 1,725 | 9/12/2020 |
8.1.11 | 2,205 | 9/11/2020 |
8.1.10 | 1,169 | 9/6/2020 |
8.1.9 | 1,098 | 9/3/2020 |
8.1.8 | 1,157 | 9/2/2020 |
8.1.7 | 1,010 | 8/28/2020 |
8.1.4 | 1,046 | 8/25/2020 |
8.1.3 | 1,098 | 8/18/2020 |
8.1.2 | 1,031 | 8/16/2020 |
8.1.1 | 1,109 | 8/15/2020 |
8.1.0 | 433 | 8/15/2020 |
8.0.1 | 2,397 | 8/7/2020 |
8.0.0 | 1,079 | 8/7/2020 |
7.0.1 | 405 | 6/28/2020 |
7.0.0 | 1,858 | 6/28/2020 |
5.0.1 | 3,051 | 5/29/2020 |
5.0.0 | 419 | 5/29/2020 |