{"id":13412666,"url":"https://github.com/jordan-wright/email","last_synced_at":"2025-04-25T14:45:12.283Z","repository":{"id":12477850,"uuid":"15146229","full_name":"jordan-wright/email","owner":"jordan-wright","description":"Robust and flexible email library for Go","archived":false,"fork":false,"pushed_at":"2024-02-21T15:25:08.000Z","size":200,"stargazers_count":2718,"open_issues_count":55,"forks_count":323,"subscribers_count":58,"default_branch":"master","last_synced_at":"2025-04-24T08:34:49.088Z","etag":null,"topics":[],"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/jordan-wright.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2013-12-12T20:11:59.000Z","updated_at":"2025-04-23T21:17:34.000Z","dependencies_parsed_at":"2024-06-18T11:01:33.487Z","dependency_job_id":"4157245f-7df2-4aa1-bf8a-283aa14b6f23","html_url":"https://github.com/jordan-wright/email","commit_stats":{"total_commits":134,"total_committers":30,"mean_commits":4.466666666666667,"dds":0.4701492537313433,"last_synced_commit":"943e75fe5223047b345337ea74d5951d19d229ed"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jordan-wright%2Femail","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jordan-wright%2Femail/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jordan-wright%2Femail/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jordan-wright%2Femail/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jordan-wright","download_url":"https://codeload.github.com/jordan-wright/email/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250836473,"owners_count":21495375,"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":[],"created_at":"2024-07-30T20:01:27.557Z","updated_at":"2025-04-25T14:45:12.256Z","avatar_url":"https://github.com/jordan-wright.png","language":"Go","readme":"email\n=====\n\n[![Build Status](https://travis-ci.org/jordan-wright/email.png?branch=master)](https://travis-ci.org/jordan-wright/email) [![GoDoc](https://godoc.org/github.com/jordan-wright/email?status.svg)](https://godoc.org/github.com/jordan-wright/email)\n\nRobust and flexible email library for Go\n\n### Email for humans\nThe ```email``` package is designed to be simple to use, but flexible enough so as not to be restrictive. The goal is to provide an *email interface for humans*.\n\nThe ```email``` package currently supports the following:\n*  From, To, Bcc, and Cc fields\n*  Email addresses in both \"test@example.com\" and \"First Last \u0026lt;test@example.com\u0026gt;\" format\n*  Text and HTML Message Body\n*  Attachments\n*  Read Receipts\n*  Custom headers\n*  More to come!\n\n### Installation\n```go get github.com/jordan-wright/email```\n\n*Note: Version \u003e 1 of this library requires Go v1.5 or above.*\n\n*If you need compatibility with previous Go versions, you can use the previous package at gopkg.in/jordan-wright/email.v1*\n\n### Examples\n#### Sending email using Gmail\n```go\ne := email.NewEmail()\ne.From = \"Jordan Wright \u003ctest@gmail.com\u003e\"\ne.To = []string{\"test@example.com\"}\ne.Bcc = []string{\"test_bcc@example.com\"}\ne.Cc = []string{\"test_cc@example.com\"}\ne.Subject = \"Awesome Subject\"\ne.Text = []byte(\"Text Body is, of course, supported!\")\ne.HTML = []byte(\"\u003ch1\u003eFancy HTML is supported, too!\u003c/h1\u003e\")\ne.Send(\"smtp.gmail.com:587\", smtp.PlainAuth(\"\", \"test@gmail.com\", \"password123\", \"smtp.gmail.com\"))\n```\n\n#### Another Method for Creating an Email\nYou can also create an email directly by creating a struct as follows:\n```go\ne := \u0026email.Email {\n\tTo: []string{\"test@example.com\"},\n\tFrom: \"Jordan Wright \u003ctest@gmail.com\u003e\",\n\tSubject: \"Awesome Subject\",\n\tText: []byte(\"Text Body is, of course, supported!\"),\n\tHTML: []byte(\"\u003ch1\u003eFancy HTML is supported, too!\u003c/h1\u003e\"),\n\tHeaders: textproto.MIMEHeader{},\n}\n```\n\n#### Creating an Email From an io.Reader\nYou can also create an email from any type that implements the ```io.Reader``` interface by using ```email.NewEmailFromReader```.\n\n#### Attaching a File\n```go\ne := NewEmail()\ne.AttachFile(\"test.txt\")\n```\n\n#### A Pool of Reusable Connections\n```go\n(var ch \u003c-chan *email.Email)\np := email.NewPool(\n\t\"smtp.gmail.com:587\",\n\t4,\n\tsmtp.PlainAuth(\"\", \"test@gmail.com\", \"password123\", \"smtp.gmail.com\"),\n)\nfor i := 0; i \u003c 4; i++ {\n\tgo func() {\n\t\tfor e := range ch {\n\t\t\tp.Send(e, 10 * time.Second)\n\t\t}\n\t}()\n}\n```\n\n### Documentation\n[http://godoc.org/github.com/jordan-wright/email](http://godoc.org/github.com/jordan-wright/email)\n\n### Other Sources\nSections inspired by the handy [gophermail](https://github.com/jpoehls/gophermail) project.\n\n### Contributors\nI'd like to thank all the [contributors and maintainers](https://github.com/jordan-wright/email/graphs/contributors) of this package.\n\nA special thanks goes out to Jed Denlea [jeddenlea](https://github.com/jeddenlea) for his numerous contributions and optimizations.\n","funding_links":[],"categories":["Email","开源类库","Go","Open source library","\u003cspan id=\"电子邮件-email\"\u003e电子邮件 Email\u003c/span\u003e","Relational Databases","邮件处理工具","邮件库","电子邮件","邮件库`邮件管理和发送的go语言库`","電子郵件","邮件"],"sub_categories":["Advanced Console UIs","邮件","Post Office","Search and Analytic Databases","\u003cspan id=\"高级控制台用户界面-advanced-console-uis\"\u003e高级控制台用户界面 Advanced Console UIs\u003c/span\u003e","Middlewares","SQL 查询语句构建库","检索及分析资料库","高级控制台界面","高級控制台界面"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjordan-wright%2Femail","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjordan-wright%2Femail","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjordan-wright%2Femail/lists"}