{"id":20631955,"url":"https://github.com/meehow/sendmail","last_synced_at":"2025-04-15T18:54:38.085Z","repository":{"id":50050848,"uuid":"99727637","full_name":"meehow/sendmail","owner":"meehow","description":"Classic, well known from PHP, method of sending emails.","archived":false,"fork":false,"pushed_at":"2021-06-05T12:37:48.000Z","size":24,"stargazers_count":18,"open_issues_count":2,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-28T23:51:14.680Z","etag":null,"topics":["email","go","golang","mail","postfix","sendmail","ssmtp"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/meehow.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}},"created_at":"2017-08-08T19:13:41.000Z","updated_at":"2024-07-09T09:50:13.000Z","dependencies_parsed_at":"2022-09-14T21:01:36.091Z","dependency_job_id":null,"html_url":"https://github.com/meehow/sendmail","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meehow%2Fsendmail","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meehow%2Fsendmail/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meehow%2Fsendmail/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meehow%2Fsendmail/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/meehow","download_url":"https://codeload.github.com/meehow/sendmail/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249135763,"owners_count":21218365,"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","go","golang","mail","postfix","sendmail","ssmtp"],"created_at":"2024-11-16T14:14:27.596Z","updated_at":"2025-04-15T18:54:38.065Z","avatar_url":"https://github.com/meehow.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"Go sendmail [![Build Status](https://travis-ci.org/meehow/sendmail.svg?branch=master)](https://travis-ci.org/meehow/sendmail)\n===========\n\nThis package implements classic, well known from PHP, method of sending emails.\nIt's stupid simple and it works not only with Sendmail,\nbut also with other MTAs, like [Postfix](http://www.postfix.org/sendmail.1.html)\nor [sSMTP](https://wiki.debian.org/sSMTP), which provide compatibility interface.\n\n* it separates email headers from email body,\n* encodes UTF-8 headers like `Subject`, `From`, `To`\n* makes it easy to use [text/template](https://golang.org/pkg/text/template)\n* doesn't require any SMTP configuration,\n* just uses `/usr/sbin/sendmail` command which is present on most of the systems,\n  * if not, just update `sendmail.Binary`\n* outputs emails to _stdout_ when environment variable `DEBUG` is set.\n\nInstallation\n------------\n```\ngo get -u github.com/meehow/sendmail\n```\n\nUsage\n-----\n```go\npackage main\n\nimport (\n\t\"io\"\n\t\"log\"\n\t\"net/mail\"\n\n\t\"github.com/meehow/sendmail\"\n)\n\nfunc main() {\n\tsm := sendmail.Mail{\n\t\tSubject: \"Cześć\",\n\t\tFrom:    \u0026mail.Address{\"Michał\", \"me@example.com\"},\n\t\tTo: []*mail.Address{\n\t\t\t{\"Ktoś\", \"info@example.com\"},\n\t\t\t{\"Ktoś2\", \"info2@example.com\"},\n\t\t},\n\t}\n\tio.WriteString(\u0026sm.Text, \":)\\r\\n\")\n\tif err := sm.Send(); err != nil {\n\t\tlog.Println(err)\n\t}\n}\n```\n\nInstead of `io.WriteString`, you can [execute a template][template]:\n\n[template]: https://golang.org/pkg/text/template/#Template.Execute\n\n```go\ntpl := template.Must(template.New(\"email\").Parse(`Hello {{.Name}}!`))\ntpl.ExecuteTemplate(\u0026sm.Text, \"email\", \u0026struct{ Name string }{\"Dominik\"})\n```\n\n\nToDo\n----\n\n* HTML emails\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeehow%2Fsendmail","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmeehow%2Fsendmail","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeehow%2Fsendmail/lists"}