{"id":20314857,"url":"https://github.com/windvalley/go-mailparser","last_synced_at":"2026-05-05T16:07:30.172Z","repository":{"id":177487209,"uuid":"660464146","full_name":"windvalley/go-mailparser","owner":"windvalley","description":"Go lib for parsing email in simple way.","archived":false,"fork":false,"pushed_at":"2023-07-03T08:12:46.000Z","size":22,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-14T12:50:20.049Z","etag":null,"topics":["email","email-parser","go-mailparser","parse-email"],"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/windvalley.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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":"2023-06-30T04:24:18.000Z","updated_at":"2025-01-07T13:23:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"c0257573-4eff-4eb0-9c2f-561587f9889e","html_url":"https://github.com/windvalley/go-mailparser","commit_stats":null,"previous_names":["windvalley/go-mailparser"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/windvalley%2Fgo-mailparser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/windvalley%2Fgo-mailparser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/windvalley%2Fgo-mailparser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/windvalley%2Fgo-mailparser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/windvalley","download_url":"https://codeload.github.com/windvalley/go-mailparser/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241818878,"owners_count":20025210,"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","go-mailparser","parse-email"],"created_at":"2024-11-14T18:16:59.262Z","updated_at":"2026-05-05T16:07:25.149Z","avatar_url":"https://github.com/windvalley.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-mailparser\n\nGo lib for parsing email in simple way.\n\n## Features\n\n- Support parsing emails with content types of `text/*` and `multipart/*`.\n- Support parsing Chinese content, such as Chinese characters in email address aliases, email subject, and email content.\n- Support parsing email attachments.\n- Support parsing emails with content encoded in base64.\n- Support parsing email headers and email content separately, or parse them all at once.\n\n## Examle\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"strings\"\n\n\t\"github.com/bytbox/go-pop3\"\n\n\t\"github.com/windvalley/go-mailparser\"\n)\n\nfunc main() {\n\tc, err := pop3.Dial(\"mail.xxx.com:110\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer func() {\n\t\tif err := c.Quit(); err != nil {\n\t\t\tfmt.Println(err)\n\t\t}\n\t}()\n\n\tif err := c.Auth(\"xxx@xxx.com\", \"yourpassword\"); err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tmsgs, _, err := c.ListAll()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tfor _, v := range msgs {\n\t\tmsg, err := c.Retr(v)\n\t\tif err != nil {\n\t\t\tfmt.Println(err)\n\t\t\tcontinue\n\t\t}\n\n\t\t// string to io.Reader\n\t\tmsgReader := strings.NewReader(msg)\n\n\t\t// parse email\n\t\tres, err := mailparser.Parse(msgReader)\n\t\tif err != nil {\n\t\t\tfmt.Println(err)\n\t\t\tcontinue\n\t\t}\n\n\t\t// check MailMessage\n\t\tfmt.Printf(\"result: %+v\\n\", res)\n\n\t\t// check attachments\n\t\tfor _, v := range res.Attachments {\n\t\t\t// You can handle the file data (v.Data) appropriately based on the content type.\n\t\t\tfmt.Printf(\"filename: %s, content-type: %s\\n\", v.Filename, v.ContentType)\n\t\t}\n\t}\n}\n```\n\n## License\n\nThis project is under the MIT License.\nSee the [LICENSE](LICENSE) file for the full license text.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwindvalley%2Fgo-mailparser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwindvalley%2Fgo-mailparser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwindvalley%2Fgo-mailparser/lists"}