diff --git a/parsemail.go b/parsemail.go index 6a60192..e3054a7 100644 --- a/parsemail.go +++ b/parsemail.go @@ -345,7 +345,7 @@ func decodeAttachment(part *multipart.Part) (at Attachment, err error) { } func decodeContent(content io.Reader, encoding string) (io.Reader, error) { - switch encoding { + switch strings.ToLower(encoding) { case "base64": decoded := base64.NewDecoder(base64.StdEncoding, content) b, err := ioutil.ReadAll(decoded) @@ -490,4 +490,4 @@ type Email struct { Attachments []Attachment EmbeddedFiles []EmbeddedFile -} \ No newline at end of file +}