Documentation ¶
Overview ¶
Parse raw email into email struct with text/plain, text/html and attachments based on https://github.com/kirabou/parseMIMEemail.go
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attachments ¶ added in v0.1.2
type Email ¶ added in v0.1.2
type Email struct { From string `json:"from"` To string `json:"to"` Subject string `json:"subject"` Date string `json:"date"` ContentType string `json:"contenttype"` BodyText string `json:"bodytext"` BodyHtml string `json:"bodyhtml"` Attachments []Attachments `json:"attachments"` Error error `json:"error"` }
func ExtractBodyFromHtmlAttachment ¶ added in v0.1.1
Some mail clients sends email with empty body, and the body itself comes as an HTML attachment. Check for length of email.bodyText, and if empty you can extract the body from one of the attachments. attachmentID is optional. If not set, function will search for the first attachment of content type HTML and extract the email from there. Function returns a new email and the attachment that was used to extract body (so you can discard it if you wish). If no attachment used it will return -1
Click to show internal directories.
Click to hide internal directories.