Documentation
¶
Overview ¶
Example ¶
package main
import (
"log"
"os"
"strings"
"github.com/jhillyerd/enmime"
"github.com/jhillyerd/enmime/cmd"
)
func main() {
mail := `From: James Hillyerd <[email protected]>
To: Greg Reader <[email protected]>, Root Node <[email protected]>
Date: Sat, 04 Dec 2016 18:38:25 -0800
Subject: Example Message
Content-Type: multipart/mixed; boundary="Enmime-Test-100"
--Enmime-Test-100
Content-Type: text/plain
Text section.
--Enmime-Test-100
Content-Type: text/html
<em>HTML</em> section.
--Enmime-Test-100--
`
// Convert MIME text to Envelope
r := strings.NewReader(mail)
env, err := enmime.ReadEnvelope(r)
if err != nil {
log.Fatal(err)
return
}
err = cmd.EnvelopeToMarkdown(os.Stdout, env, "Example Message Output")
if err != nil {
log.Fatal(err)
return
}
}
Output: Example Message Output ====================== ## Header Content-Type: multipart/mixed; boundary="Enmime-Test-100" Date: Sat, 04 Dec 2016 18:38:25 -0800 ## Envelope ### From - James Hillyerd `<[email protected]>` ### To - Greg Reader `<[email protected]>` - Root Node `<[email protected]>` ### Subject Example Message ## Body Text Text section. ## Body HTML <em>HTML</em> section. ## Attachment List ## MIME Part Tree multipart/mixed |-- text/plain `-- text/html
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnvelopeToMarkdown ¶
EnvelopeToMarkdown renders the contents of an enmime.Envelope in Markdown format. Used by mime-dump and mime-extractor commands.
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package main outputs a markdown formatted document describing the provided email
|
Package main outputs a markdown formatted document describing the provided email |
|
Package main extracts attachments from the provided email
|
Package main extracts attachments from the provided email |
Click to show internal directories.
Click to hide internal directories.