{"id":17494457,"url":"https://github.com/morkid/go-mailer-api","last_synced_at":"2025-03-28T18:19:28.972Z","repository":{"id":197009452,"uuid":"256219202","full_name":"morkid/go-mailer-api","owner":"morkid","description":"Golang Mailer Rest API and CLI","archived":false,"fork":false,"pushed_at":"2020-11-10T10:47:32.000Z","size":29,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-09-28T16:23:04.554Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/morkid.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}},"created_at":"2020-04-16T13:13:26.000Z","updated_at":"2023-09-28T16:23:21.926Z","dependencies_parsed_at":null,"dependency_job_id":"c7379125-99d7-4cfe-a092-aba6075b38b0","html_url":"https://github.com/morkid/go-mailer-api","commit_stats":null,"previous_names":["morkid/go-mailer-api"],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morkid%2Fgo-mailer-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morkid%2Fgo-mailer-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morkid%2Fgo-mailer-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morkid%2Fgo-mailer-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/morkid","download_url":"https://codeload.github.com/morkid/go-mailer-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246076930,"owners_count":20719894,"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-10-19T13:26:21.728Z","updated_at":"2025-03-28T18:19:28.935Z","avatar_url":"https://github.com/morkid.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Send email with Rest API or CLI\n\nSimple way to send email over **Rest API** and **CLI**.\n\nBuild app (golang required):\n```bash\ngo get -d\ngo build -o mailer .\nmailer --help\n```\n\n# CLI options\ntype `mailer --help` to display all available options\n```\n-attachment value\n      Set email attachments\n-bcc value\n      BCC, define multiple to send more than one bcc\n-body string\n      Set email body\n-cc value\n      CC, define multiple to send more than one cc\n-debug\n      enable debug (default false)\n-endpoint string\n      Start http with endpoint (default \"/\")\n-from string\n      Set Sender email\n-help\n      Display this help\n-host string\n      Set email host\n-http\n      Enable http server\n-password string\n      Set email password\n-plain-text\n      Send email as plaintext. (default false)\n-port int\n      Start http with port (default 8080)\n-provider string\n      Set email provider, eg: gmail\n-single\n      single email per receiver. (default false)\n-subject string\n      Set email subject\n-to value\n      Receiver Email, define multiple to send more than one receiver\n-username string\n      Set email username\n```\n\n# Send email using CLI\nExample:\n```bash\nmailer --provider gmail \\\n  --from my@gmail.com \\\n  --password s3cr3t \\\n  --to receiver1@mail.com \\\n  --to receiver2@mail.com \\\n  --subject \"Send from cli\" \\\n  --body \"Hello \u003cb\u003eworld\u003c/b\u003e\" \\\n  --attachment file1.txt \\\n  --attachment file2.txt\n```\nDon't forget to enable less secure apps to your gmail as a sender  \n[Enable less secure apps](https://support.google.com/a/answer/6260879)\n\n# Send email using Rest API\nYou must start http server before send email using Rest API:\n```\nmailer --http --port 8765 --endpoint /api/v1/mailer\n```\n\nSend email using curl:\n```\ncurl -X POST \\\n  -H 'Content-type: application/json' \\\n  -d '{\n        \"from\": \"my@gmail.com\",\n        \"password\": \"s3cr3t\",\n        \"to\": [\n            \"receiver@gmail.com\"\n        ],\n        \"subject\": \"Send from Rest API\",\n        \"body\": \"Hello \u003cb\u003eworld\u003c/b\u003e\",\n        \"attachments\": [\n            {\n                \"name\": \"image.png\",\n                \"data\": \"data:image/png,base64,TG9yZW0gaXBzdW0gZG9sb3Igc2l0IGFtZXQ=\"\n            }\n        ]\n    }' \\\n  http://localhost:8765/api/v1/mailer\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorkid%2Fgo-mailer-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmorkid%2Fgo-mailer-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorkid%2Fgo-mailer-api/lists"}