{"id":27768026,"url":"https://github.com/koddr/go-email-sender","last_synced_at":"2025-04-29T19:59:07.964Z","repository":{"id":57626185,"uuid":"401321647","full_name":"koddr/go-email-sender","owner":"koddr","description":"📮 Simple (but useful) email sender written in pure Go v1.17. Support HTML templates and attachments.","archived":false,"fork":false,"pushed_at":"2023-02-08T11:56:26.000Z","size":28,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-29T19:58:59.787Z","etag":null,"topics":["email","email-sender","email-template","go","golang","smtp","smtp-protocol"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/koddr/go-email-sender","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/koddr.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}},"created_at":"2021-08-30T11:38:46.000Z","updated_at":"2024-03-30T14:18:33.000Z","dependencies_parsed_at":"2024-01-30T07:12:25.125Z","dependency_job_id":null,"html_url":"https://github.com/koddr/go-email-sender","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koddr%2Fgo-email-sender","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koddr%2Fgo-email-sender/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koddr%2Fgo-email-sender/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koddr%2Fgo-email-sender/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/koddr","download_url":"https://codeload.github.com/koddr/go-email-sender/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251574671,"owners_count":21611387,"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-sender","email-template","go","golang","smtp","smtp-protocol"],"created_at":"2025-04-29T19:59:07.466Z","updated_at":"2025-04-29T19:59:07.951Z","avatar_url":"https://github.com/koddr.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 📮 Go Email Sender\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/koddr/go-email-sender.svg)](https://pkg.go.dev/github.com/koddr/go-email-sender)\n\nSimple (but useful) email sender written in pure Go `v1.17`. Yes, _yet another_ email package here! 😅\n\nSupport **HTML templates** and **attachments**.\n\n## Send HTML email\n\nMethod signature:\n\n```go\nfunc (s *Sender) SendHTMLEmail(\n    templatePath string,\n    to []string,\n    cc []string,\n    subject string,\n    data interface{},\n    files []string,\n) error\n```\n\nExample:\n\n```go\n// Create a new struct for the email data.\ntype HTMLEmailData struct {\n    Name    string\n    Website string\n}\n\n// Create a new SMTP sender instance with your auth params.\nsender := NewEmailSender(\"mail@test.com\", \"secret\", \"smtp.test.com\", 25)\n\n// Send the email with an HTML template.\nif err := sender.SendHTMLEmail(\n    \"my/templates/welcome.html\", // path to the HTML template\n    []string{\n        \"mail@example.com\",      // slice of emails to send\n    },\n    []string{\n        \"copy-mail@example.com\", // slice of emails to send message copy\n    },\n    \"It's a test email!\",        // subject of the email\n    \u0026HTMLEmailData{\n        Name:    \"Vic\",\n        Website: \"https://shostak.dev/\",\n    },\n    []string{\n        \"my/files/image.jpg\",    // slice of files to send\n    },\n); err != nil {\n    // Throw error message, if something went wrong.\n    return fmt.Errorf(\"Something went wrong: %v\", err)\n}\n```\n\n## Send plain text email\n\nMethod signature:\n\n```go\nfunc (s *Sender) SendPlainEmail(\n    to []string,\n    cc []string,\n    subject string,\n    data interface{},\n    files []string,\n) error\n```\n\nExample:\n\n```go\n// Create a new SMTP sender instance with your auth params.\nsender := NewEmailSender(\"mail@test.com\", \"secret\", \"smtp.test.com\", 25)\n\n// Send the email with a plain text.\nif err := sender.SendPlainEmail(\n    []string{\n        \"mail@example.com\",       // slice of emails to send\n    },\n    []string{\n        \"copy-mail@example.com\",  // slice of emails to send message copy\n    },\n    \"It's a test email!\",         // subject of the email\n    \"Here is a plain text body.\", // body of the email\n    []string{\n        \"my/files/image.jpg\",     // slice of files to send\n    },\n); err != nil {\n    // Throw error message, if something went wrong.\n    return fmt.Errorf(\"Something went wrong: %v\", err)\n}\n```\n\n## ⚠️ License\n\nApache-2.0 © [Vic Shóstak](https://github.com/koddr) \u0026 [True web artisans](https://truewebartisans.com).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoddr%2Fgo-email-sender","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkoddr%2Fgo-email-sender","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoddr%2Fgo-email-sender/lists"}