{"id":34842375,"url":"https://github.com/serialt/smail","last_synced_at":"2026-04-01T20:30:14.741Z","repository":{"id":231020733,"uuid":"635329398","full_name":"serialt/smail","owner":"serialt","description":null,"archived":false,"fork":false,"pushed_at":"2023-06-23T10:35:06.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-04-17T21:19:07.633Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Makefile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/serialt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2023-05-02T13:13:21.000Z","updated_at":"2023-05-02T13:32:27.000Z","dependencies_parsed_at":"2024-04-02T04:06:35.221Z","dependency_job_id":"1fa60534-06a5-4551-a1fb-dbb651f32892","html_url":"https://github.com/serialt/smail","commit_stats":null,"previous_names":["serialt/smail"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/serialt/smail","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serialt%2Fsmail","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serialt%2Fsmail/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serialt%2Fsmail/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serialt%2Fsmail/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/serialt","download_url":"https://codeload.github.com/serialt/smail/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serialt%2Fsmail/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31291644,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T13:12:26.723Z","status":"ssl_error","status_checked_at":"2026-04-01T13:12:25.102Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":"2025-12-25T17:14:04.357Z","updated_at":"2026-04-01T20:30:14.672Z","avatar_url":"https://github.com/serialt.png","language":"Makefile","funding_links":[],"categories":[],"sub_categories":[],"readme":"## smail\n\n### for cmd\n```shell\ngo install github.com/serialt/smail/cmd/smail@latest\n```\n\n### for lib\n```go\npackage main\n\nimport (\n\t\"flag\"\n\t\"log\"\n\t\"strings\"\n\n\t\"github.com/serialt/smail\"\n\t\"github.com/serialt/sugar/v3\"\n)\n\nvar (\n\trecvUser string\n\tsubject  string\n\tbody     string\n\tfilename string\n\tmailtype string\n)\n\ntype Config struct {\n\tMailer smail.Mailer `yaml:\"mailer\"`\n}\n\n// Recver 邮件信息处理\nfunc init() {\n\tflag.StringVar(\u0026recvUser, \"c\", \"\", \"收邮件地址,格式为 a11@qq.com,a22@gmail.com\")\n\tflag.StringVar(\u0026mailtype, \"t\", \"\", \"邮件发送方式,g 群发邮件,s 一对一发邮件,默认是g\")\n\tflag.StringVar(\u0026subject, \"s\", \"\", \"邮件主题\")\n\tflag.StringVar(\u0026body, \"m\", \"\", \"邮件内容\")\n\tflag.StringVar(\u0026filename, \"f\", \"\", \"添加的附件\")\n\tflag.Parse()\n}\n\nfunc main() {\n\tvar confg *Config\n\terr := sugar.LoadConfig(\"/Users/serialt/.smail.yaml\", \u0026confg)\n\tif err != nil {\n\t\tlog.Fatalf(\"Read config failed: %v\", err)\n\t}\n\tmail := confg.Mailer\n\tmail.MailTo = strings.Split(recvUser, \",\")\n\tmail.Subject = subject\n\tmail.Body = body\n\tmail.Filename = filename\n\n\tswitch mailtype {\n\tcase \"g\", \"\":\n\t\terr := mail.SendMailByGroup()\n\t\tif err != nil {\n\t\t\tlog.Println(\"Send mail failed\", err)\n\t\t\treturn\n\t\t}\n\t\tlog.Println(\"Send mail successfully!\")\n\tdefault:\n\t\terr := mail.SendMail()\n\t\tif err != nil {\n\t\t\tlog.Println(\"Send mail failed\", err)\n\t\t\treturn\n\t\t}\n\t\tlog.Println(\"Send mail successfully!\")\n\n\t}\n\n}\n\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserialt%2Fsmail","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fserialt%2Fsmail","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserialt%2Fsmail/lists"}