{"id":13674048,"url":"https://github.com/DusanKasan/parsemail","last_synced_at":"2025-04-28T13:32:10.749Z","repository":{"id":19768089,"uuid":"87855855","full_name":"DusanKasan/parsemail","owner":"DusanKasan","description":"Simple email parsing for Golang","archived":false,"fork":false,"pushed_at":"2024-03-28T12:52:53.000Z","size":69,"stargazers_count":209,"open_issues_count":21,"forks_count":141,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-04T20:14:17.814Z","etag":null,"topics":["email","email-parser","email-parsing","go","golang"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DusanKasan.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-10T20:43:36.000Z","updated_at":"2025-03-25T09:23:43.000Z","dependencies_parsed_at":"2024-06-18T13:31:44.405Z","dependency_job_id":null,"html_url":"https://github.com/DusanKasan/parsemail","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DusanKasan%2Fparsemail","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DusanKasan%2Fparsemail/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DusanKasan%2Fparsemail/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DusanKasan%2Fparsemail/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DusanKasan","download_url":"https://codeload.github.com/DusanKasan/parsemail/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251319757,"owners_count":21570451,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["email","email-parser","email-parsing","go","golang"],"created_at":"2024-08-02T11:00:36.786Z","updated_at":"2025-04-28T13:32:05.676Z","avatar_url":"https://github.com/DusanKasan.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# Parsemail - simple email parsing Go library\n\n[![Build Status](https://circleci.com/gh/DusanKasan/parsemail.svg?style=shield\u0026circle-token=:circle-token)](https://circleci.com/gh/DusanKasan/parsemail) [![Coverage Status](https://coveralls.io/repos/github/DusanKasan/Parsemail/badge.svg?branch=master)](https://coveralls.io/github/DusanKasan/Parsemail?branch=master) [![Go Report Card](https://goreportcard.com/badge/github.com/DusanKasan/parsemail)](https://goreportcard.com/report/github.com/DusanKasan/parsemail)\n\nThis library allows for parsing an email message into a more convenient form than the `net/mail` provides. Where the `net/mail` just gives you a map of header fields and a `io.Reader` of its body, Parsemail allows access to all the standard header fields set in [RFC5322](https://tools.ietf.org/html/rfc5322), html/text body as well as attachements/embedded content as binary streams with metadata.\n\n## Simple usage\n\nYou just parse a io.Reader that holds the email data. The returned Email struct contains all the standard email information/headers  as public fields.\n\n```go\nvar reader io.Reader // this reads an email message\nemail, err := parsemail.Parse(reader) // returns Email struct and error\nif err != nil {\n    // handle error\n}\n\nfmt.Println(email.Subject)\nfmt.Println(email.From)\nfmt.Println(email.To)\nfmt.Println(email.HTMLBody)\n```\n\n## Retrieving attachments\n\nAttachments are a easily accessible as `Attachment` type, containing their mime type, filename and data stream.\n\n```go\nvar reader io.Reader\nemail, err := parsemail.Parse(reader)\nif err != nil {\n    // handle error\n}\n\nfor _, a := range(email.Attachments) {\n    fmt.Println(a.Filename)\n    fmt.Println(a.ContentType)\n    //and read a.Data\n}\n```\n\n## Retrieving embedded files\n\nYou can access embedded files in the same way you can access attachments. They contain the mime type, data stream and content id that is used to reference them through the email.\n\n```go\nvar reader io.Reader\nemail, err := parsemail.Parse(reader)\nif err != nil {\n    // handle error\n}\n\nfor _, a := range(email.EmbeddedFiles) {\n    fmt.Println(a.CID)\n    fmt.Println(a.ContentType)\n    //and read a.Data\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDusanKasan%2Fparsemail","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FDusanKasan%2Fparsemail","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDusanKasan%2Fparsemail/lists"}