https://github.com/begriffs/mimedown
markdown to multipart mime
https://github.com/begriffs/mimedown
Last synced: 11 months ago
JSON representation
markdown to multipart mime
- Host: GitHub
- URL: https://github.com/begriffs/mimedown
- Owner: begriffs
- License: isc
- Created: 2020-06-11T03:49:21.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2021-02-20T22:05:07.000Z (about 5 years ago)
- Last Synced: 2024-04-12T19:53:23.457Z (almost 2 years ago)
- Language: C
- Homepage:
- Size: 103 KB
- Stars: 79
- Watchers: 7
- Forks: 3
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Markdown to multipart MIME
Answering the age-old debate: HTML or plaintext emails? Both!
Write email in markdown, and convert to multipart MIME that works impeccably in
graphical and console mail clients.
* Creates a conservative [ISO/IEC 15445:2000
HTML](https://www.iso.org/standard/27688.html) representation, which is set
as the preferred multipart alternative for graphical clients.
* The text alternative is reflowed at 72 characters to look good in standard
console mail readers.
* The text part also uses format=flowed, so it will shrink on narrow screens or
terminal splits.
* Fenced code blocks in the markdown are added as inline attachments with the
appropriate MIME type. This makes them easy to download/save from the
message.
* URLs are listed at the bottom of the text message in a special
`text/uri-list` inline attachment, and referred to with short codes like
`[0]`, `[1]` ... in the message text.
### Installation
Written in portable C99. The only requirement is the
[cmark](https://github.com/commonmark/cmark) library to parse markdown.
```sh
# detect cmark and set up build flags
./configure
# then build md2mime
make
```
### Usage
```sh
./md2mime sender-domain.com < message.md > message.email
```
The sender domain is required to generate a good Message-ID.
If the original message starts with headers, pass `-p` to preserve them. Send
the message using a program like [msmtp](https://marlam.de/msmtp/):
```sh
msmtp recipient@example.com < message.email
```