{"id":17914206,"url":"https://github.com/knadh/smtppool","last_synced_at":"2025-05-15T23:07:02.122Z","repository":{"id":42160492,"uuid":"262846034","full_name":"knadh/smtppool","owner":"knadh","description":"High throughput Go SMTP pool library with graceful handling of idle timeouts, errors, and retries.","archived":false,"fork":false,"pushed_at":"2025-03-29T11:27:28.000Z","size":57,"stargazers_count":153,"open_issues_count":0,"forks_count":32,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-08T10:34:23.947Z","etag":null,"topics":["email-client","email-sender","pool","smtp","smtp-client"],"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/knadh.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":"2020-05-10T18:04:13.000Z","updated_at":"2025-03-31T06:10:40.000Z","dependencies_parsed_at":"2024-01-04T19:28:06.606Z","dependency_job_id":"203316a5-064b-4fe1-91e2-c73345f4d1f4","html_url":"https://github.com/knadh/smtppool","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knadh%2Fsmtppool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knadh%2Fsmtppool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knadh%2Fsmtppool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knadh%2Fsmtppool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/knadh","download_url":"https://codeload.github.com/knadh/smtppool/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254436948,"owners_count":22070947,"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-client","email-sender","pool","smtp","smtp-client"],"created_at":"2024-10-28T19:56:49.215Z","updated_at":"2025-05-15T23:06:56.724Z","avatar_url":"https://github.com/knadh.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ca href=\"https://zerodha.tech\"\u003e\u003cimg src=\"https://zerodha.tech/static/images/github-badge.svg\" align=\"right\" /\u003e\u003c/a\u003e\n\nsmtppool\n========\n\nsmtppool is a Go library that creates a pool of reusable SMTP connections for high throughput e-mailing. It gracefully handles idle connections, timeouts, and retries. The e-mail formatting, parsing, and preparation code is forked from [jordan-wright/email](https://github.com/jordan-wright/email).\n\n\n### Install\n```go get github.com/knadh/smtppool/v2```\n\n\n#### Usage\n```go\npackage main\n\nimport (\n\t\"log\"\n\t\"time\"\n\n\t\"github.com/knadh/smtppool/v2\"\n)\n\nfunc main() {\n\t// Try https://github.com/mailhog/MailHog for running a local dummy SMTP server.\n\t// Create a new pool.\n\tpool, err := smtppool.New(smtppool.Opt{\n\t\tHost:            \"localhost\",\n\t\tPort:            1025,\n\t\tMaxConns:        10,\n\t\tIdleTimeout:     time.Second * 10,\n\t\tPoolWaitTimeout: time.Second * 3,\n\t\tSSL:             smtppool.SSLNone\n\t})\n\tif err != nil {\n\t\tlog.Fatalf(\"error creating pool: %v\", err)\n\t}\n\n\te:= smtppool.Email{\n\t\tFrom:    \"John Doe \u003cjohn@example.com\u003e\",\n\t\tTo:      []string{\"doe@example.com\"},\n\n\t\t// Optional.\n\t\tBcc:     []string{\"doebcc@example.com\"},\n\t\tCc:      []string{\"doecc@example.com\"},\n\n\t\tSubject: \"Hello, World\",\n\t\tText:    []byte(\"This is a test e-mail\"),\n\t\tHTML:    []byte(\"\u003cstrong\u003eThis is a test e-mail\u003c/strong\u003e\"),\n\t}\n\n\t// Add attachments.\n\tif _, err := e.AttachFile(\"test.txt\"); err != nil {\n\t\tlog.Fatalf(\"error attaching file: %v\", err)\n\t}\n\n\tif err := pool.Send(e); err != nil {\n\t\tlog.Fatalf(\"error sending e-mail: %v\", err)\n\t}\n}\n```\n\nLicensed under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknadh%2Fsmtppool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fknadh%2Fsmtppool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknadh%2Fsmtppool/lists"}